Merge pull request #50451 from SebTardif

* fix-processrunner-interrupt-flag:
  Restore interrupt flag in ProcessRunner on InterruptedException

Closes gh-50451
This commit is contained in:
Stéphane Nicoll
2026-05-29 12:29:44 +02:00
@@ -122,7 +122,8 @@ class ProcessRunner {
return process.waitFor();
}
catch (InterruptedException ex) {
throw new IllegalStateException("Interrupted waiting for %s".formatted(process));
Thread.currentThread().interrupt();
throw new IllegalStateException("Interrupted waiting for %s".formatted(process), ex);
}
}
@@ -174,6 +175,7 @@ class ProcessRunner {
return this.output.toString();
}
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
return null;
}
}