Browse Source

Fix buffering quirk in py3: if the read would return EAGAIN then readinto would return none (instead of raising).

Ionel Cristian Mărieș 11 năm trước cách đây
mục cha
commit
c3c98a5bb2
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      celery/concurrency/workhorse.py

+ 2 - 1
celery/concurrency/workhorse.py

@@ -163,7 +163,8 @@ class TaskPool(BasePool):
         si = signalfd_siginfo()
         while True:
             try:
-                self.sigfh.readinto(si)
+                if not self.sigfh.readinto(si):
+                    break
             except IOError as exc:
                 if exc.errno != errno.EAGAIN:
                     raise