mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 07:23:00 +00:00
Avoid zombie processes in case of using LocalProcessSpawner
This commit is contained in:
@@ -722,6 +722,7 @@ class ConfigurableHTTPProxy(Proxy):
|
||||
def _check_process():
|
||||
status = self.proxy_process.poll()
|
||||
if status is not None:
|
||||
with self.proxy_process:
|
||||
e = RuntimeError("Proxy failed to start with exit code %i" % status)
|
||||
raise e from None
|
||||
|
||||
|
@@ -1542,6 +1542,9 @@ class LocalProcessSpawner(Spawner):
|
||||
if self.proc is not None:
|
||||
status = self.proc.poll()
|
||||
if status is not None:
|
||||
# handle SIGCHILD to avoid zombie processes
|
||||
# and also close stdout/stderr file descriptors
|
||||
with self.proc:
|
||||
# clear state if the process is done
|
||||
self.clear_state()
|
||||
return status
|
||||
|
Reference in New Issue
Block a user