Commits

Michael Heemskerk  committed 2165e1e

Fix to ensure that the new ExternalProcessImpl#awaitPumpOrProcess returns when the thread is interrupted

  • Participants
  • Parent commits ed4c58d

Comments (0)

Files changed (1)

File src/main/java/com/atlassian/utils/process/ExternalProcessImpl.java

     private void awaitPumpOrProcess(LatchedRunnable runnable, long latestTime) {
         if (runnable != null) {
             boolean finished = false;
-            while (!finished && System.currentTimeMillis() < latestTime && isAlive()) {
+            while (!finished && System.currentTimeMillis() < latestTime && isAlive() && !Thread.currentThread().isInterrupted()) {
                 long timeout = Math.min(1000, latestTime - System.currentTimeMillis());
                 if (timeout < 1) {
                     timeout = 1;