RFR: 8333742: ProcessImpl and ProcessHandleImpl may mishandle processes that exit with code 259 [v2]

Roger Riggs rriggs at openjdk.org
Mon Jun 10 19:48:14 UTC 2024


On Mon, 10 Jun 2024 16:24:27 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> Another reason to retain the checking of GetThreadInterruptEvent is to be belt and suspenders against the Java code changing and opening up a potential error. At the moment, the reaper thread is encapsulated and not likely to get an interrupt, but that might not always be the case and someone changing the Java code might be unaware of the native code details.  $.02
>
> I did some research, and now I'm pretty confident that WaitForSingleObject is the right option:
> - the thread involved here is a daemon thread, i.e. it doesn't prevent JVM exit
> - the Unix version of `waitForProcessExit0` ignores interrupts and signals, it only ends when the wait succeeds or fails
> - I didn't observe any problems with exiting the JVM while waiting on a process handle
> - it's not clear to me what action we would take if the thread was cancelled; completing a CompletableFuture with an InterruptedException doesn't feel right.

ok, I'll buy that argument

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19586#discussion_r1633748785


More information about the core-libs-dev mailing list