RFR: 8000817: Reinstate accidentally removed sleep() from ProcessBuilder/Basic.java

Alan Bateman Alan.Bateman at oracle.com
Fri Oct 12 18:47:23 UTC 2012

On 12/10/2012 19:25, Martin Buchholz wrote:
> :
> Yeah, this kind of race is hard to eradicate.  The bug remains on Linux?
> Maybe we should throw away what we did and instead loop until we see 
> something like
> java.io.FileInputStream.readBytes(Native Method)
> in the read-ing thread's stack trace.
Yes, this one remains on Linux, and the original one that Rob fixed was 
in response to a couple of intermittent failures on Solaris.

Checking for readBytes should be better but it might still be fragile 
because there isn't any guarantee that the thread is in the read syscall 
(although the window should be a lot smaller). Although none of us like 
using sleep, this may be a case where we need a short sleep to improve 
our chances.


More information about the core-libs-dev mailing list