Explorar o código

Try to handle broken pid files.

Ask Solem %!s(int64=15) %!d(string=hai) anos
pai
achega
201287922d
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      celery/bin/celeryd.py

+ 4 - 0
celery/bin/celeryd.py

@@ -168,6 +168,10 @@ def acquire_pidlock(pidfile):
             sys.stderr.write("Stale pidfile exists. Removing it.\n")
             os.unlink(pidfile)
             return PIDLockFile(pidfile)
+    except TypeError, exc:
+        sys.stderr.write("Broken pidfile found. Removing it.\n")
+        os.unlink(pidfile)
+        return PIDLockFile(pidfile)
     else:
         raise SystemExit(
                 "ERROR: Pidfile (%s) already exists.\n"