1 parent 691de87 commit c634b12Copy full SHA for c634b12
1 file changed
src/main/java/io/github/easy4j/kimi/acp/KimiAcpClient.java
@@ -474,6 +474,16 @@ public void close() {
474
process = null;
475
if (current != null) {
476
current.destroy();
477
+ // A child that ignores SIGTERM must not outlive the client —
478
+ // escalate to destroyForcibly (SIGKILL) after a short grace period.
479
+ try {
480
+ if (!current.waitFor(500, TimeUnit.MILLISECONDS)) {
481
+ current.destroyForcibly();
482
+ }
483
+ } catch (InterruptedException e) {
484
485
+ Thread.currentThread().interrupt();
486
487
}
488
failAllPending(new KimiException("kimi acp client closed"));
489
state.set(KimiAcpState.CLOSED);
0 commit comments