Skip to content

Commit 8bb7bfd

Browse files
committed
Log error code if waitpid raises
1 parent 427eb2b commit 8bb7bfd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

supervisor/options.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,12 +1343,14 @@ def waitpid(self):
13431343
# left zombies laying around.
13441344
try:
13451345
pid, sts = os.waitpid(-1, os.WNOHANG)
1346-
except OSError as why:
1347-
err = why.args[0]
1348-
if err not in (errno.ECHILD, errno.EINTR):
1346+
except OSError as exc:
1347+
code = exc.args[0]
1348+
if code not in (errno.ECHILD, errno.EINTR):
13491349
self.logger.critical(
1350-
'waitpid error; a process may not be cleaned up properly')
1351-
if err == errno.EINTR:
1350+
'waitpid error %r; '
1351+
'a process may not be cleaned up properly' % code
1352+
)
1353+
if code == errno.EINTR:
13521354
self.logger.blather('EINTR during reap')
13531355
pid, sts = None, None
13541356
return pid, sts

0 commit comments

Comments
 (0)