RFR 8177932 (process) java/lang/ProcessHandle/OnExitTest.java failed with "Process A should not be alive"
frank.yuan at oracle.com
Thu Sep 7 05:46:28 UTC 2017
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!
From: core-libs-dev [mailto:core-libs-dev-bounces at openjdk.java.net] 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
meaning the pid had been re-used and the process was no longer alive.
ProcessHandle.isAlive considered zero to be missing information and the
process was still alive.
More information about the core-libs-dev