From 8f5d5184c850c0922ca821a8d9e75eae9d2bc78c Mon Sep 17 00:00:00 2001 From: Andy Damevin Date: Fri, 26 Sep 2025 10:47:17 +0200 Subject: [PATCH] Fix interrupted exception on kill --- core/src/main/java/io/mvnpm/esbuild/Execute.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/io/mvnpm/esbuild/Execute.java b/core/src/main/java/io/mvnpm/esbuild/Execute.java index 28a253e0..31f4c4c2 100644 --- a/core/src/main/java/io/mvnpm/esbuild/Execute.java +++ b/core/src/main/java/io/mvnpm/esbuild/Execute.java @@ -87,7 +87,6 @@ public void close() throws IOException { process.waitFor(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); - throw new RuntimeException(e); } if (latch.getCount() == 1) { latch.countDown(); @@ -105,10 +104,12 @@ public void close() throws IOException { } }, r -> { try { - process.waitFor(); + if (process.isAlive()) { + process.destroyForcibly(); + process.waitFor(); + } } catch (InterruptedException e) { Thread.currentThread().interrupt(); - throw new RuntimeException(e); } if (latch.getCount() == 1) { result.set(r);