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 1Sii21-0002da-NW for garchives@archives.gentoo.org; Sun, 24 Jun 2012 08:18:56 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 063BDE0C2D; Sun, 24 Jun 2012 08:18:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id CDC92E0C2D for ; Sun, 24 Jun 2012 08:18:30 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 41BC51B4061 for ; Sun, 24 Jun 2012 08:18:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 03EF7E5431 for ; Sun, 24 Jun 2012 08:18:29 +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: <1340525892.fe03b5fd790fc09bd6594c55bb174e80aaac1e5a.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/PollScheduler.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: fe03b5fd790fc09bd6594c55bb174e80aaac1e5a X-VCS-Branch: master Date: Sun, 24 Jun 2012 08:18:29 +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: 703ff179-b491-4387-a466-c9438ef70545 X-Archives-Hash: 1b054910b652cfb00214ddf31aaec09b commit: fe03b5fd790fc09bd6594c55bb174e80aaac1e5a Author: Zac Medico gentoo org> AuthorDate: Sun Jun 24 08:18:12 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Jun 24 08:18:12 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dfe03b5fd PollScheduler: schedule inside loop if max_load This will fix a case like that reported in bug #403895, triggered when the --load-average option is used. --- pym/_emerge/PollScheduler.py | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py index 965dc20..5103e31 100644 --- a/pym/_emerge/PollScheduler.py +++ b/pym/_emerge/PollScheduler.py @@ -148,15 +148,22 @@ class PollScheduler(object): def _main_loop(self): term_check_id =3D self.sched_iface.idle_add(self._termination_check) try: - # Populate initial event sources. We only need to do - # this once here, since it can be called during the - # loop from within event handlers. + # Populate initial event sources. Unless we're scheduling + # based on load average, we only need to do this once + # here, since it can be called during the loop from within + # event handlers. self._schedule() + max_load =3D self._max_load =20 # Loop while there are jobs to be scheduled. while self._keep_scheduling(): self.sched_iface.iteration() =20 + if max_load is not None: + # We have to schedule periodically, in case the load + # average has changed since the last call. + self._schedule() + # Clean shutdown of previously scheduled jobs. In the # case of termination, this allows for basic cleanup # such as flushing of buffered output to logs.