RFR: 6402201: ProcessAttachTest.sh needs better synchronization

Jaroslav Bachorik jaroslav.bachorik at oracle.com
Tue Nov 19 01:38:05 PST 2013


On 19.11.2013 10:33, Dmitry Samersoff wrote:
> Jaroslav,
>
> Use fuser command to wait until file being closed is better way to do it
>
> if fuser -s filename; then Busy; else Ready; fi

Thanks. Will try it. Currently I am rewriting such tests to java and 
using stdout redirection instead.

-JB-

>
> -Dmitry
>
>
> On 2013-11-19 13:00, Jaroslav Bachorik wrote:
>> On 19.11.2013 09:45, Alan Bateman wrote:
>>> On 18/11/2013 23:29, Erik Gahlin wrote:
>>>> Could I have a review of this test fix.
>>>>
>>>> It appears it takes more than 10 s to write to a file on slow
>>>> machines. Instead of sleeping 10 s the test now polls for the file to
>>>> appear. There may be other issues with the test, but it's hard to know
>>>> without ruling this race out.
>>>>
>>>> Thanks
>>>> Erik
>>>>
>>>> Testing:
>>>> - I have run the test 20+ times locally on a highly saturated CPU
>>>> without failure
>>>> - JPRT.
>>>>
>>>> Bug:
>>>> https://bugs.openjdk.java.net/browse/JDK-6402201
>>>>
>>>> Webrev:
>>>> http://cr.openjdk.java.net/~egahlin/6402201_1/
>>> This looks okay to me. The only thing that comes to mind is whether it
>>> is possible for to observe the port file before the port is written.
>>
>> I think it is. Writing to a file does not guarantee that it's creation
>> and actual write are atomic :(
>>
>> What I used to do was to write the data to one file and the use a second
>> signaling file to notify the other party that the data has been
>> successfully written and can be read.
>>
>> -JB-
>>
>>> Keeping the sleep so that it happens after you've file the file without
>>> significantly reduce that possibility.
>>>
>>> -Alan.
>>
>
>



More information about the serviceability-dev mailing list