PR #3946 should be reverted; JVM `Process#waitFor` can validly return InterruptedException
The JVM 8 documentation explicitly describes several Process.waitFor methods as capable of returning
InterruptedException. Java 22, and presumably intermediate versions, allow this capability.
PR #3946 explicitly disallows this capability and should be reverted.
I do not know what problem PR #3946 was designed to solve, but it appears that problem will need to be solved in another way.
The change was introduced to improve debugging. When attaching the debugger to the process it would also receive the interrupt signal. It means that before we would be able to lookup the state of the program, it would already start executing the erroneous path of throwing the IOExceotion. Because the signal was delivered, but the isInterrupted flag of Java thread was not set up it means it was a spurious, unwanted interruption. In oppose to that thread.interrupt was send both signal and set the flag. In such case throwing exception on detected unwanted signal and restarting the waitFor seemed to be the most expected approach
I suggest putting that behavior under a DEBUG flag/configuration_option and keeping the "normal" behavior as specified by the JVM.
Thanks for the info.