aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-07-22 13:16:42 -0700
committerZac Medico <zmedico@gentoo.org>2020-07-22 13:20:11 -0700
commitc14ac733a4e05990973d99e13f19aaf9bde57bcb (patch)
tree1f2b37ced79acd4a65a0476fb7d0c203cda1c695 /lib/_emerge
parentMergeProcess: handle cancelled future in _proc_join_done (diff)
downloadportage-c14ac733a4e05990973d99e13f19aaf9bde57bcb.tar.gz
portage-c14ac733a4e05990973d99e13f19aaf9bde57bcb.tar.bz2
portage-c14ac733a4e05990973d99e13f19aaf9bde57bcb.zip
_EbuildFetcherProcess: emit eerror for fetch failure in _proc_join_done
Since ForkProcess now receives process exit status in the _proc_join_done method instead of the _async_waitpid_cb method, _EbuildFetcherProcess needs to emit eerror messages there instead. Fixes: bde44b75407d ("ForkProcess: replace os.fork with multiprocessing.Process (bug 730192)") Bug: https://bugs.gentoo.org/730192 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge')
-rw-r--r--lib/_emerge/EbuildFetcher.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/_emerge/EbuildFetcher.py b/lib/_emerge/EbuildFetcher.py
index 55349c33c..107a6d590 100644
--- a/lib/_emerge/EbuildFetcher.py
+++ b/lib/_emerge/EbuildFetcher.py
@@ -364,16 +364,11 @@ class _EbuildFetcherProcess(ForkProcess):
if msg:
self.scheduler.output(msg, log_path=self.logfile)
- def _async_waitpid_cb(self, *args, **kwargs):
+ def _proc_join_done(self, proc, future):
"""
- Override _async_waitpid_cb to perform cleanup that is
- not necessarily idempotent.
+ Extend _proc_join_done to emit an eerror message for fetch failure.
"""
- ForkProcess._async_waitpid_cb(self, *args, **kwargs)
- # Collect elog messages that might have been
- # created by the pkg_nofetch phase.
- # Skip elog messages for prefetch, in order to avoid duplicates.
- if not self.prefetch and self.returncode != os.EX_OK:
+ if not self.prefetch and not future.cancelled() and proc.exitcode != os.EX_OK:
msg_lines = []
msg = "Fetch failed for '%s'" % (self.pkg.cpv,)
if self.logfile is not None:
@@ -382,3 +377,4 @@ class _EbuildFetcherProcess(ForkProcess):
if self.logfile is not None:
msg_lines.append(" '%s'" % (self.logfile,))
self._eerror(msg_lines)
+ super(_EbuildFetcherProcess, self)._proc_join_done(proc, future)