Browse Source

Have to revert patch for issue #523 because of performance degredation, until we find a better solution

Ask Solem 13 years ago
parent
commit
8107ff983d
1 changed files with 2 additions and 5 deletions
  1. 2 5
      celery/concurrency/processes/pool.py

+ 2 - 5
celery/concurrency/processes/pool.py

@@ -797,11 +797,8 @@ class Pool(object):
             warnings.warn(UserWarning("Soft timeouts are not supported: "
             warnings.warn(UserWarning("Soft timeouts are not supported: "
                     "on this platform: It does not have the SIGUSR1 signal."))
                     "on this platform: It does not have the SIGUSR1 signal."))
             soft_timeout = None
             soft_timeout = None
-        if waitforslot and self._putlock is not None:
-            while 1:
-                if self._state != RUN or self._putlock.acquire(False):
-                    break
-                time.sleep(1.0)
+        if waitforslot and self._putlock is not None and self._state == RUN:
+            self._putlock.acquire()
         if self._state == RUN:
         if self._state == RUN:
             result = ApplyResult(self._cache, callback,
             result = ApplyResult(self._cache, callback,
                                  accept_callback, timeout_callback,
                                  accept_callback, timeout_callback,