We have not see any issues with pid re-use and I would prefer to avoid over engineering the code for a non-issue.
Yes, I agree. With the proposed fix, the onExit completion handler and isAlive are consistent. I mean, in ProcessHandleImpl.isAlive(), startTime is the final filed of the ProcessHandleImpl instance, in onExit(), the pid of the ProcessHandleImpl instance is passed to completion function, and then origStart is assigned with the return value of isAlive0(pid), at this time, the value of origStart may be different with startTime of the ProcessHandleImpl instance, so onExit() of the ProcessHandleImpl instance is inconsistent with isAlive()of the same ProcessHandleImpl instance. Anyway, it may be a non-issue:) b. Should we rollback the change of JDK-8184808, at least, update the comment in that change? I'll update the comment. Double checking using kill seems to be more reliable. c. Should we remove @key intermittent and the debug info added in JDK-8183019? I'd prefer to leave them for some to make sure the issue does not re-appear. I created a subtask to re-check in 2 months. Thank you for your follow-up! Frank Roger Thanks Frank -----Original Message----- From: core-libs-dev [mailto:[email protected]] On Behalf Of Roger Riggs Subject: RFR 8177932 (process) java/lang/ProcessHandle/OnExitTest.java failed with "Process A should not be alive" Please review a fix for an intermittent issue with ProcessHandle.onExit. On Solaris, the start time of a process reported through /proc/pid/psinfo changes to zero when the process is exiting. The onExit implementation incorrectly interpreted zero meaning the pid had been re-used and the process was no longer alive. However, ProcessHandle.isAlive considered zero to be missing information and the process was still alive. Webrev: http://cr.openjdk.java.net/~rriggs/webrev-onexit-8177932/ Issue: https://bugs.openjdk.java.net/browse/JDK-8177932 Thanks, Roger
