RFR of JDK-8029360: java/rmi/transport/dgcDeadLock/DGCDeadLock.java failing intermittently

Daniel Fuchs daniel.fuchs at oracle.com
Tue Dec 20 10:35:13 UTC 2016


Hi Hamlin,

DGCDeadLock.java:

   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
> subprocess).
>     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"
>   Solution:
>     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
> -Hamlin



More information about the core-libs-dev mailing list