also catch ProcessLookupError in is_zombie_process()

Summary:
I saw an integration test failure because `eden shutdown` encountered a
`ProcessLookupError`.  This was thrown by the `proc_stat.read()` call.
Update this function to also expect this exception type if the process has
exited after we opened the file but before we could read it.

Reviewed By: strager

Differential Revision: D13521580

fbshipit-source-id: 027ad562024b5f05684e82cd940987eea2349077
This commit is contained in:
Adam Simpkins 2018-12-19 20:11:49 -08:00 committed by Facebook Github Bot
parent 9e21449bee
commit 1b49161fce

View File

@ -88,7 +88,7 @@ def is_zombie_process(pid: int) -> bool:
pieces = line.split()
if len(pieces) > 2 and pieces[2] == b"Z":
return True
except FileNotFoundError:
except (FileNotFoundError, ProcessLookupError):
pass
return False