Skip to content

Commit c634b12

Browse files
committed
fix(acp): 同步 destroyForcibly 升级 + 勾选 hardening tasks(JDK 8 适配)
1 parent 691de87 commit c634b12

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎src/main/java/io/github/easy4j/kimi/acp/KimiAcpClient.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,16 @@ public void close() {
474474
process = null;
475475
if (current != null) {
476476
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+
current.destroyForcibly();
485+
Thread.currentThread().interrupt();
486+
}
477487
}
478488
failAllPending(new KimiException("kimi acp client closed"));
479489
state.set(KimiAcpState.CLOSED);

0 commit comments

Comments
 (0)