Skip to content

Commit

Permalink
Backport PR #88: Kill the subprocess if it does not stop (#89)
Browse files Browse the repository at this point in the history
Co-authored-by: Afshin Taylor Darian <git@darian.af>
  • Loading branch information
meeseeksmachine and afshin authored May 8, 2020
1 parent 64965eb commit 857c050
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jupyterlab_server/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ def terminate(self):

# Wait for the process to close.
try:
proc.wait()
proc.wait(timeout=1.)
except TimeoutError:
if os.name == 'nt':
os.kill(proc.pid, signal.SIGBREAK)
else:
os.kill(proc.pid, signal.SIGKILL)
finally:
Process._procs.remove(self)

Expand Down

0 comments on commit 857c050

Please sign in to comment.