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 5A01F1382C5 for ; Sun, 22 Apr 2018 17:50:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6D675E082F; Sun, 22 Apr 2018 17:50:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 4BEC3E082F for ; Sun, 22 Apr 2018 17:50:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 5C953335C78 for ; Sun, 22 Apr 2018 17:50:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7213B272 for ; Sun, 22 Apr 2018 17:50:03 +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: <1524419332.d836b0d32797f1431ebeaa20e2a18ea5cb7c3f7c.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/_async/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/_async/AsyncFunction.py X-VCS-Directories: pym/portage/util/_async/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: d836b0d32797f1431ebeaa20e2a18ea5cb7c3f7c X-VCS-Branch: master Date: Sun, 22 Apr 2018 17:50:03 +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-Archives-Salt: b4c2c113-8550-4d02-83db-61ada7e987d0 X-Archives-Hash: 58132966ab1acf43eb0a3f296ef38a78 commit: d836b0d32797f1431ebeaa20e2a18ea5cb7c3f7c Author: Zac Medico gentoo org> AuthorDate: Sun Apr 22 15:56:29 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Apr 22 17:48:52 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d836b0d3 AsyncFunction: use _async_waitpid (bug 591760) When pid exit status is not yet available, use the Subprocess _async_waitpid() method to avoid event loop recursion. Bug: https://bugs.gentoo.org/591760 pym/portage/util/_async/AsyncFunction.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pym/portage/util/_async/AsyncFunction.py b/pym/portage/util/_async/AsyncFunction.py index 40f6c5e75..ad3d8333f 100644 --- a/pym/portage/util/_async/AsyncFunction.py +++ b/pym/portage/util/_async/AsyncFunction.py @@ -57,8 +57,11 @@ class AsyncFunction(ForkProcess): # and returned an unsuccessful returncode. pass self._async_func_reader = None - self._unregister() - self.wait() + if self.returncode is None: + self._async_waitpid() + else: + self._unregister() + self._async_wait() def _unregister(self): ForkProcess._unregister(self)