Skip to content

Commit dffda87

Browse files
whitewhite
authored andcommitted
fix: add hardShutdown() method delay
1 parent 721cbae commit dffda87

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

python-embed-runtime/src/main/java/io/github/howtis/pythonembed/PythonProcessManager.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ void hardShutdown() {
182182
running = false;
183183
if (process != null && process.isAlive()) {
184184
process.destroyForcibly();
185+
try {
186+
process.waitFor(2, TimeUnit.SECONDS);
187+
} catch (InterruptedException e) {
188+
Thread.currentThread().interrupt();
189+
}
185190
}
186191
protocol.cancelAll(new RuntimeException("Python process terminated (JVM shutdown)"));
187192
}

0 commit comments

Comments
 (0)