RFR 10: 8184808 (process) isAlive should use pid for validity, not /proc/pid

Roger Riggs Roger.Riggs at Oracle.com
Wed Jul 19 19:47:38 UTC 2017


Hi Felix,

OnExitTest is unchanged and was the test the discovered the bug; so I 
don't think it needs a @bug.

Thanks, Roger


On 7/19/2017 12:27 AM, Felix Yang wrote:
> Hi Roger,
>
>      is it necessary to add the bug id to OnExitTest?
>
> -Felix
> On 2017/7/19 2:46, Roger Riggs wrote:
>> Please review a fix for an intermittent failure in the ProcessHandle 
>> OnExitTest
>> that fails frequently on Solaris.
>>
>> ProcessHandle.isAlive is using /proc/pid/psinfo to determine if a 
>> process is alive and it's start time.
>> However, it appears that the between the process exiting and the 
>> reaping of its status, the
>> psinfo file indicates the process is alive but kill(pid, 0) reports 
>> that is is not alive.
>> Depending on a race, the ProcessHandler.onExit may determine the 
>> process has exited
>> but later isAlive may report it is alive.
>>
>> To have a consistent view of the process being alive, 
>> ProcessHandle.isAlive in its native implementation
>> should use kill(pid, 0) to determine if the process is definitively 
>> determine if the process alive.
>>
>> The original issue[1] will be kept open until it is known that it is 
>> resolved.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~rriggs/webrev-alive-solaris-8184808/
>>
>> Issue:
>>    https://bugs.openjdk.java.net/browse/JDK-8184808
>>
>> Thanks, Roger
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8177932
>>
>>
>



More information about the core-libs-dev mailing list