RFR of JDK-8029360: java/rmi/transport/dgcDeadLock/DGCDeadLock.java failing intermittently
huaming.li at oracle.com
Wed Dec 21 01:36:07 UTC 2016
Thank you for reviewing, modified as you suggested and pushed the code.
On 2016/12/20 18:35, Daniel Fuchs wrote:
> Hi Hamlin,
> 61 public static boolean finished = false;
> 62 static DGCDeadLock test = new DGCDeadLock();
> 63 static int registryPort = -1;
> 1. 'finished' and 'registryPort' should be volatile since they are
> written and read by multiple threads.
> 2. 'test' should be final.
> The rest looks reasonable to me.
> -- daniel
> On 20/12/16 07:10, Hamlin Li wrote:
>> Would you please review the below patch?
>> bug: https://bugs.openjdk.java.net/browse/JDK-8029360
>> webrev: http://cr.openjdk.java.net/~mli/8029360/webrev.00/
>> * For the "connection refused" and "port in use" issue:
>> Root Cause: consider reproducing scenario,
>> 1. gets free port A (in main process).
>> 2. interloper occupies port A.
>> 3. starts registry subprocess and try to listen on port A (in
>> 4. registry fails with "port in use" (in subprocess).
>> 5. interloper releases port A.
>> 6. Naming.lookup on port A, it fails with "connection refused"
>> To fix the issue, use REGISTRY to start registry process on
>> ephemeral port and pass the port back to main process.
>> * For another issue, log is short, can only guess that wait time is not
>> long enough on busy machine, so fix the issue by scaling the wait time
>> and using REGISTRY to synchronize.
>> Thank you
More information about the core-libs-dev