Skip to content

Commit ba3709d

Browse files
author
Mark Pollack
committed
Fix noisy WARN log for expected SIGTERM exit codes (143, 137)
1 parent 6e26b8e commit ba3709d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

acp-core/src/main/java/com/agentclientprotocol/sdk/client/transport/StdioAcpClientTransport.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,13 @@ public Mono<Void> closeGracefully() {
383383
return Mono.<Process>empty();
384384
}
385385
})).doOnNext(process -> {
386-
if (process.exitValue() != 0) {
387-
logger.warn("Process terminated with code {}", process.exitValue());
386+
int exitCode = process.exitValue();
387+
// 143 = SIGTERM (128+15), 137 = SIGKILL (128+9) - expected when we destroy
388+
if (exitCode == 0 || exitCode == 143 || exitCode == 137) {
389+
logger.info("ACP agent process stopped (exit code {})", exitCode);
388390
}
389391
else {
390-
logger.info("ACP agent process stopped");
392+
logger.warn("Process terminated unexpectedly with code {}", exitCode);
391393
}
392394
}).then(Mono.fromRunnable(() -> {
393395
try {

0 commit comments

Comments
 (0)