Forráskód Böngészése

[Prefork] Forgot to commit part of memory leak fix (Issue #2927)

Ask Solem 9 éve
szülő
commit
4b70e55ee8
1 módosított fájl, 5 hozzáadás és 0 törlés
  1. 5 0
      celery/concurrency/asynpool.py

+ 5 - 0
celery/concurrency/asynpool.py

@@ -19,6 +19,7 @@
 from __future__ import absolute_import
 
 import errno
+import gc
 import os
 import select
 import socket
@@ -409,6 +410,10 @@ class AsynPool(_pool.Pool):
             self.on_soft_timeout = self._timeout_handler.on_soft_timeout
             self.on_hard_timeout = self._timeout_handler.on_hard_timeout
 
+    def _create_worker_process(self, i):
+        gc.collect()  # Issue #2927
+        return super(AsynPool, self)._create_worker_process(i)
+
     def _event_process_exit(self, hub, proc):
         # This method is called whenever the process sentinel is readable.
         self._untrack_child_process(proc, hub)