Ask Solem 8 years ago
parent
commit
25815d23d2
4 changed files with 18 additions and 10 deletions
  1. 4 0
      .landscape.yml
  2. 5 5
      celery/bin/logtool.py
  3. 3 1
      celery/concurrency/eventlet.py
  4. 6 4
      celery/concurrency/gevent.py

+ 4 - 0
.landscape.yml

@@ -37,5 +37,9 @@ pylint:
         - dangerous-default-value
         - unused-argument
         - protected-access
+        - invalid-name
+        - too-many-instance-attributes
+        - bad-builtin
+        - abstract-method
     options:
         exclude-protected: _reader, _writer, _popen, _sentinel_poll, _job, _is_alive, _write_to, _scheduled_for, _terminated, _accepted, _set_terminated, _payload, _cancel

+ 5 - 5
celery/bin/logtool.py

@@ -15,11 +15,11 @@ from .base import Command
 
 __all__ = ['logtool']
 
-RE_LOG_START = re.compile('^\[\d\d\d\d\-\d\d-\d\d ')
-RE_TASK_RECEIVED = re.compile('.+?\] Received')
-RE_TASK_READY = re.compile('.+?\] Task')
-RE_TASK_INFO = re.compile('.+?([\w\.]+)\[(.+?)\].+')
-RE_TASK_RESULT = re.compile('.+?[\w\.]+\[.+?\] (.+)')
+RE_LOG_START = re.compile(r'^\[\d\d\d\d\-\d\d-\d\d ')
+RE_TASK_RECEIVED = re.compile(r'.+?\] Received')
+RE_TASK_READY = re.compile(r'.+?\] Task')
+RE_TASK_INFO = re.compile(r'.+?([\w\.]+)\[(.+?)\].+')
+RE_TASK_RESULT = re.compile(r'.+?[\w\.]+\[.+?\] (.+)')
 
 REPORT_FORMAT = """
 Report

+ 3 - 1
celery/concurrency/eventlet.py

@@ -49,7 +49,7 @@ class Timer(_timer.Timer):
         self._spawn_after = spawn_after
         self._queue = set()
 
-    def _enter(self, eta, priority, entry):
+    def _enter(self, eta, priority, entry, **kwargs):
         secs = max(eta - monotonic(), 0)
         g = self._spawn_after(secs, entry)
         self._queue.add(g)
@@ -97,6 +97,8 @@ class TaskPool(base.BasePool):
     signal_safe = False
     is_green = True
     task_join_will_block = False
+    _pool = None
+    _quick_put = None
 
     def __init__(self, *args, **kwargs):
         from eventlet import greenthread

+ 6 - 4
celery/concurrency/gevent.py

@@ -11,7 +11,7 @@ except ImportError:  # pragma: no cover
 from kombu.async import timer as _timer
 from kombu.five import monotonic
 
-from .base import apply_target, BasePool
+from . import base
 
 __all__ = ['TaskPool']
 
@@ -19,7 +19,7 @@ __all__ = ['TaskPool']
 def apply_timeout(target, args=(), kwargs={}, callback=None,
                   accept_callback=None, pid=None, timeout=None,
                   timeout_callback=None, Timeout=Timeout,
-                  apply_target=apply_target, **rest):
+                  apply_target=base.apply_target, **rest):
     try:
         with Timeout(timeout):
             return apply_target(target, args, kwargs, callback,
@@ -42,7 +42,7 @@ class Timer(_timer.Timer):
         super(Timer, self).__init__(*args, **kwargs)
         self._queue = set()
 
-    def _enter(self, eta, priority, entry):
+    def _enter(self, eta, priority, entry, **kwargs):
         secs = max(eta - monotonic(), 0)
         g = self._Greenlet.spawn_later(secs, entry)
         self._queue.add(g)
@@ -72,7 +72,7 @@ class Timer(_timer.Timer):
         return self._queue
 
 
-class TaskPool(BasePool):
+class TaskPool(base.BasePool):
     """GEvent Pool."""
 
     Timer = Timer
@@ -80,6 +80,8 @@ class TaskPool(BasePool):
     signal_safe = False
     is_green = True
     task_join_will_block = False
+    _pool = None
+    _quick_put = None
 
     def __init__(self, *args, **kwargs):
         from gevent import spawn_raw