Update Scheduler to protect against infinite loop
authorDavid James <davidjames@google.com>
Thu, 17 Mar 2011 04:54:37 +0000 (21:54 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 18 Mar 2011 19:49:12 +0000 (12:49 -0700)
If we have running tasks, but we're not listening to these tasks,
we're going to loop forever. So throw an exception in this case.

pym/_emerge/Scheduler.py

index 5d190428fb80789ee167a9d9fdc07266b79c6764..fa4825cf2058bbbe24ba4690a61a95a332315b32 100644 (file)
@@ -1681,15 +1681,13 @@ class Scheduler(PollScheduler):
                        self._set_max_jobs(1)
 
                while self._schedule():
-                       if self._poll_event_handlers:
-                               self._poll_loop()
+                       self._poll_loop()
 
                while True:
                        self._schedule()
                        if not self._is_work_scheduled():
                                break
-                       if self._poll_event_handlers:
-                               self._poll_loop()
+                       self._poll_loop()
 
        def _keep_scheduling(self):
                return bool(not self._terminated_tasks and self._pkg_queue and \