Skip to content

Commit 4880ca1

Browse files
committed
PythonContext: try hard(er) to kill daemon threads
1 parent a240b8c commit 4880ca1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonContext.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,13 @@ private void shutdownThreads() {
877877
// the threading module above. So we just interrupt them. Their exit is handled
878878
// in the acquireGil function, which will be interrupted for these threads
879879
disposeThread(thread);
880-
thread.interrupt();
881-
thread.join();
880+
for (int i = 0; i < 100; i++) {
881+
thread.interrupt();
882+
thread.join(2);
883+
}
884+
if (thread.isAlive()) {
885+
LOGGER.warning("could not join thread " + thread.getName());
886+
}
882887
}
883888
}
884889
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)