JDK-8019538 : TEST_BUG: java/rmi/activation/rmidViaInheritedChannel tests may fail
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.rmi
  • Affected Version: 7,8u381,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-07-01
  • Updated: 2023-08-17
  • Resolved: 2016-12-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b148Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
A couple rmidViaInheritedChannel tests can fail. See attached JTR files. They failed during an ordinary run on my desktop. This might be because they use "reserved" ports, and because those ports might have been in use by something else on my system at the time. The "reserved" ports aren't really reserved; what's "reserved" about them is that the RMI test library avoids them when creating unique ports, but there is nothing to prevent something else in the system from using them. This suggests that these tests may need to be adapted to use the unique port assignment scheme.

The tests in question are:

    java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java
    java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java

Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/5f8fbe4288ef User: lana Date: 2016-12-07 19:33:44 +0000
07-12-2016

URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/5f8fbe4288ef User: mli Date: 2016-12-01 01:43:54 +0000
01-12-2016

RFR: http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-November/044977.html There are 4 issues in the bug, 2 in RmidViaInheritedChannel.java: "port in use" in registry, "port in use" in rmid start. 2 InheritedChannelNotServerSocket.java: "port in use" in registry, "port in use" in rmid start. The patch under reviewed fixes 2 issues in RmidViaInheritedChannel, and only "port in use" in registry in InheritedChannelNotServerSocket. The "port in use" in rmid in InheritedChannelNotServerSocket is little bit hard, as it intends to test rmid when inherited channel not work. Currently the only solution in my mind is to retry when rmid fails with "port in use", but as we discussed earlier, it's not a good solution as it might impact other programs or tests, and it's not efficient. So I hope to push the fix for the other issues first to improve the stability of RMI tests. The "port in use" in rmid in InheritedChannelNotServerSocket will be tracked with a new bug after this fix is pushed.
30-11-2016

RFR: http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-November/044977.html There are 4 issues in the bug, 2 in RmidViaInheritedChannel.java: "port in use" in registry, "port in use" in rmid start. 2 InheritedChannelNotServerSocket.java: "port in use" in registry, "port in use" in rmid start. This patch fixes 2 issues in RmidViaInheritedChannel, and only "port in use" in registry in InheritedChannelNotServerSocket. The "port in use" in rmid in InheritedChannelNotServerSocket is little bit hard, as it intends to test rmid when inherited channel not work. Currently the only solution in my mind is to retry when rmid fails with "port in use", but as we discussed earlier, it's not a good solution as it might impact other programs or tests, and it's not efficient. So I hope to push the fix for the other issues first to improve the stability of RMI tests, and keep studying if there are other better solutions for the "port in use" in rmid in InheritedChannelNotServerSocket.
24-11-2016

http://java.se.oracle.com/mach5/job/9-dev/1481/artifact/testresults/linux-x64/jdk_test.tier3/JTwork/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.jtr/*view*/
11-11-2016

The relevant bit of the failure log for RmidViaInheritedChannel.java is: ----------System.err:(35/2302)---------- export callback object and bind in registry java.rmi.server.ExportException: Port already in use: 64002; nested exception is: java.net.BindException: Address already in use at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:329) at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:237) at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411) at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147) at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:207) at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:122) at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:108) at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203) at RmidViaInheritedChannel.main(RmidViaInheritedChannel.java:78) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:491) at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94) at java.lang.Thread.run(Thread.java:744) Caused by: java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:382) at java.net.ServerSocket.bind(ServerSocket.java:375) at java.net.ServerSocket.<init>(ServerSocket.java:237) at java.net.ServerSocket.<init>(ServerSocket.java:128) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:45) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:344) at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:666) at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:318) ... 14 more
30-01-2014

TESTFAIL:java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java TESTFAIL:java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java
18-12-2013

We should drop use of static port numbers. I think the TestLibrary.getUnusedRandomPort() helper method would work well here.
19-11-2013