Browse Source

Pool: Process timed out by TimeoutHandler must be joined by the Supervisor, so don't remove it from self._pool. Closes #192.

Ask Solem 14 years ago
parent
commit
2101f8e0a2
1 changed files with 1 additions and 9 deletions
  1. 1 9
      celery/concurrency/processes/pool.py

+ 1 - 9
celery/concurrency/processes/pool.py

@@ -235,14 +235,6 @@ class TimeoutHandler(PoolThread):
                     return process, index
             return None, None
 
-        def _pop_by_pid(pid):
-            process, index = _process_by_pid(pid)
-            if not process:
-                return
-            p = processes.pop(index)
-            assert p is process
-            return process
-
         def _timed_out(start, timeout):
             if not start or not timeout:
                 return False
@@ -272,7 +264,7 @@ class TimeoutHandler(PoolThread):
         def _on_hard_timeout(job, i):
             debug('hard time limit exceeded for %i', i)
             # Remove from _pool
-            process = _pop_by_pid(job._worker_pid)
+            process, _index = _process_by_pid(job._worker_pid)
             # Remove from cache and set return value to an exception
             job._set(i, (False, TimeLimitExceeded()))
             # Run timeout callback