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 6A8D21382C5 for ; Thu, 26 Apr 2018 08:06:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AB1BFE0823; Thu, 26 Apr 2018 08:06:07 +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 89BF2E0823 for ; Thu, 26 Apr 2018 08:06: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 B2DD3335C76 for ; Thu, 26 Apr 2018 08:06:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 57FF829B for ; Thu, 26 Apr 2018 08:06:05 +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: <1524729748.d16206ccd315edbd4bd7a46c0b1aa9e59a46db43.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/AsyncScheduler.py X-VCS-Directories: pym/portage/util/_async/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: d16206ccd315edbd4bd7a46c0b1aa9e59a46db43 X-VCS-Branch: master Date: Thu, 26 Apr 2018 08:06:05 +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: 69f22968-9751-4668-83d7-5cab34e39652 X-Archives-Hash: 2bfa58b1bdf54e5ca1c1adcd2218c036 commit: d16206ccd315edbd4bd7a46c0b1aa9e59a46db43 Author: Zac Medico gentoo org> AuthorDate: Thu Apr 26 07:45:32 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Apr 26 08:02:28 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d16206cc AsyncScheduler._poll(): fix event loop recursion (bug 591760) Call self._cleanup() and set the returncode, in order to avoid event loop recursion in self.wait(). Bug: https://bugs.gentoo.org/591760 pym/portage/util/_async/AsyncScheduler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pym/portage/util/_async/AsyncScheduler.py b/pym/portage/util/_async/AsyncScheduler.py index b89b57dab..1b870c771 100644 --- a/pym/portage/util/_async/AsyncScheduler.py +++ b/pym/portage/util/_async/AsyncScheduler.py @@ -29,7 +29,12 @@ class AsyncScheduler(AsynchronousTask, PollScheduler): def _poll(self): if not (self._is_work_scheduled() or self._keep_scheduling()): - self.wait() + self._cleanup() + + if self._error_count > 0: + self.returncode = 1 + else: + self.returncode = os.EX_OK return self.returncode def _cancel(self):