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