From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Q0gx2-000491-VG for garchives@archives.gentoo.org; Fri, 18 Mar 2011 21:11:17 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5281EE0024; Fri, 18 Mar 2011 21:11:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0BF1DE0024 for ; Fri, 18 Mar 2011 21:11:08 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 868B51B4063 for ; Fri, 18 Mar 2011 21:11:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id EA84E8006A for ; Fri, 18 Mar 2011 21:11:07 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/CompositeTask.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: e8fc5d66e57a8a84214fec16610c6a44804e219a Date: Fri, 18 Mar 2011 21:11:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: d7b020c13d8102d24e4ee5e5371b107f commit: e8fc5d66e57a8a84214fec16610c6a44804e219a Author: Zac Medico gentoo org> AuthorDate: Fri Mar 18 21:05:07 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Mar 18 21:05:07 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3De8fc5d66 CompositeTask: fix _wait for TASK_QUEUED Though this case might never have been triggered, the logic was broken for cases in which self.cancelled was false and a task was queued. In this case we need to call back into the scheduler until the queued task is started or we are cancelled, whichever comes first. --- pym/_emerge/CompositeTask.py | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/CompositeTask.py b/pym/_emerge/CompositeTask.py index edc0768..644a69b 100644 --- a/pym/_emerge/CompositeTask.py +++ b/pym/_emerge/CompositeTask.py @@ -55,9 +55,21 @@ class CompositeTask(AsynchronousTask): # don't wait for the same task more than once break if task is self._TASK_QUEUED: - self.returncode =3D 1 - self._current_task =3D None - break + if self.cancelled: + self.returncode =3D 1 + self._current_task =3D None + break + else: + self.scheduler.schedule(condition=3Dself._task_queued_wait) + if self.returncode is not None: + break + elif self.cancelled: + self.returncode =3D 1 + self._current_task =3D None + break + else: + # try this again with new _current_task value + continue if task is prev: if self.returncode is not None: # This is expected if we're being @@ -139,3 +151,7 @@ class CompositeTask(AsynchronousTask): =20 def _task_queued_start_handler(self, task): self._current_task =3D task + + def _task_queued_wait(self): + return self._current_task is not self._TASK_QUEUED or \ + self.cancelled or self.returncode is not None