diff options
author | Zac Medico <zmedico@gentoo.org> | 2020-03-01 11:28:33 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2020-03-01 12:30:42 -0800 |
commit | 97587a47fcd00d070c081ad3933e4036cf0f8e81 (patch) | |
tree | 7fa1bbd97c82eeb23438303514d163579ce057a6 | |
parent | Add python3.9 support (diff) | |
download | portage-97587a47.tar.gz portage-97587a47.tar.bz2 portage-97587a47.zip |
SpawnProcess: cancel _main_task in _unregister (bug 711174)
Cancel _main_task in _unregister, in order to ensure that the build
log is properly closed. Note that is analogous to the fix for bug
658806 in commit a9a62e57194c, but behavior related to coroutine
cancellation now plays a role since the PipeLogger is now cancelled
indirectly via _main_task. We still need to verify that coroutine
cancellation will raise an appropriate exception in the coroutine
(asyncio.CancelledError, GeneratorExit, or StopIteration) and also
that the specific coroutine will react appropriately to the
specific exception that will be raised.
Fixes: 8074127bbc21 ("SpawnProcess: add _main coroutine")
Bug: https://bugs.gentoo.org/711174
Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r-- | lib/_emerge/SpawnProcess.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/_emerge/SpawnProcess.py b/lib/_emerge/SpawnProcess.py index 34668b287..bf5c45189 100644 --- a/lib/_emerge/SpawnProcess.py +++ b/lib/_emerge/SpawnProcess.py @@ -218,6 +218,8 @@ class SpawnProcess(SubProcess): if self.cgroup is not None: self._cgroup_cleanup() self.cgroup = None + if self._main_task is not None: + self._main_task.done() or self._main_task.cancel() def _cancel(self): SubProcess._cancel(self) |