Skip to content

Commit 2e02467

Browse files
committed
Add timeout for worker shutdown
1 parent e781640 commit 2e02467

File tree

1 file changed

+7
-1
lines changed
  • graalpython/com.oracle.graal.python.test/src

1 file changed

+7
-1
lines changed

graalpython/com.oracle.graal.python.test/src/runner.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,14 @@ def process_event(event):
613613
while pipe.poll(0.1):
614614
pipe.recv()
615615
break
616+
try:
617+
returncode = process.wait(60)
618+
except subprocess.TimeoutExpired:
619+
log("Warning: Worker didn't shutdown in a timely manner, interrupting it")
620+
interrupt_process(process)
621+
622+
process.wait()
616623

617-
returncode = process.wait()
618624
if self.stop_event.is_set():
619625
return
620626
if use_pipe:

0 commit comments

Comments
 (0)