From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3CB9C138359 for ; Wed, 22 Jul 2020 19:52:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 644D2E087F; Wed, 22 Jul 2020 19:52:07 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4D69BE087F for ; Wed, 22 Jul 2020 19:52:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 18BDE34F1A5 for ; Wed, 22 Jul 2020 19:52:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9811F9C for ; Wed, 22 Jul 2020 19:52:04 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1595446653.f587ebf3d4920b6c3cae3654918ba9cda6625a3e.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/dbapi/_MergeProcess.py X-VCS-Directories: lib/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: f587ebf3d4920b6c3cae3654918ba9cda6625a3e X-VCS-Branch: master Date: Wed, 22 Jul 2020 19:52:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: da300985-2b8b-484f-b7e2-487616066a47 X-Archives-Hash: dbf2d50eb1f83192b52f09e4383f9678 commit: f587ebf3d4920b6c3cae3654918ba9cda6625a3e Author: Zac Medico gentoo org> AuthorDate: Wed Jul 22 19:32:38 2020 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Jul 22 19:37:33 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f587ebf3 MergeProcess: handle RETURNCODE_POSTINST_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, MergeProcess needs to handle RETURNCODE_POSTINST_FAILURE there instead. Fixes: 3561071e07ad ("MergeProcess: replace os.fork with multiprocessing.Process (bug 730192)") Signed-off-by: Zac Medico gentoo.org> lib/portage/dbapi/_MergeProcess.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/portage/dbapi/_MergeProcess.py b/lib/portage/dbapi/_MergeProcess.py index 6924c8b0e..85deedc18 100644 --- a/lib/portage/dbapi/_MergeProcess.py +++ b/lib/portage/dbapi/_MergeProcess.py @@ -195,15 +195,14 @@ class MergeProcess(ForkProcess): prev_mtimes=self.prev_mtimes, counter=counter) return rval - 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 react to RETURNCODE_POSTINST_FAILURE. """ - ForkProcess._async_waitpid_cb(self, *args, **kwargs) - if self.returncode == portage.const.RETURNCODE_POSTINST_FAILURE: + if proc.exitcode == portage.const.RETURNCODE_POSTINST_FAILURE: self.postinst_failure = True self.returncode = os.EX_OK + super(MergeProcess, self)._proc_join_done(proc, future) def _unregister(self): """