Explorar o código

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

Ask Solem %!s(int64=9) %!d(string=hai) anos
pai
achega
4d90a281da
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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
@@ -427,6 +428,10 @@ class AsynPool(_pool.Pool):
             self._timeout_handler, 'on_hard_timeout', noop,
         )
 
+    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)