From 09007c7f0acca19c39dfe234e7f9151a07b008a3 Mon Sep 17 00:00:00 2001 From: Gaurav Jain Date: Sun, 21 Jun 2015 14:11:56 -0700 Subject: [PATCH] Catch OSError as well as ValueError on race condition The fix for issue #863 was incomplete as both OSError or ValueError could be raised by os.fstat(). Thus we need to catch both types of exceptions --- gunicorn/arbiter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 7ec4a3f8..fb6762c3 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -429,7 +429,7 @@ class Arbiter(object): try: if time.time() - worker.tmp.last_update() <= self.timeout: continue - except ValueError: + except (OSError, ValueError): continue if not worker.aborted: