RFR of JDK-8153543: java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java fails intermittently

Hamlin Li huaming.li at oracle.com
Tue Nov 22 02:50:45 UTC 2016


Would you please review the patch for below bug?

bug: https://bugs.openjdk.java.net/browse/JDK-8153543
webrev: http://cr.openjdk.java.net/~mli/8153543/webrev.00/

Root cause: between "TestLibrary.getUnusedRandomPort()" and 
"UnicastRemoteObject.exportObject(impl, 0);", there is time window, 
interloper might step in and get the port.
Solution: use port 0 to create server socket in RMI socket factory, then 
pass the exact port back.

Thank you
-Hamlin


More information about the core-libs-dev mailing list