[DING] Re: [PING] Potential infinite waiting at JMXConnection#createConnection
Roger Riggs
Roger.Riggs at Oracle.com
Thu Mar 3 19:48:19 UTC 2016
Hi Yuji,
An issue has been created to track this issue:
JDK-8151212 <https://bugs.openjdk.java.net/browse/JDK-8151212> Flush in
RMI TCPChannel createConnection can hang indefinitely
Please send the patch and the reproducer in the body of email and I'll
attach them to the bug report.
Thanks, Roger
On 2/3/2016 12:27 PM, KUBOTA Yuji wrote:
> Hi all,
>
> Could someone please review and sponsor this fix ?
> I write the details of this issue again. Please review it.
>
> =Problem=
> Potential infinite waiting at TCPChannel#createConnection.
>
> This method flushes the DataOutputStream without the socket
> timeout settings when choose stream protocol [1]. If connection lost
> or the destination server do not return response during the flush,
> this method wait forever because the timeout settings is set the
> default value of SO_TIMEOUT, i.e., infinite.
>
> [1]: http://hg.openjdk.java.net/jdk9/dev/jdk/file/7adef1c3afd5/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPChannel.java#l227
>
> I think this issue is rarely, however serious.
>
> =Reproduce=
> I write a test program to reproduce. You can reproduce by the below.
>
> * hg clone http://icedtea.classpath.org/people/ykubota/fixLoopAtJMXConnectorFactory/
> * cd fixLoopAtJMXConnectorFactory; mvn package
> * setting "stop_time" at debugcontrol.properties if you need.
> * java -cp .:target/debugcontrol-1.0-SNAPSHOT.jar debugcontrol.DebugController
>
> This program keep to wait at TCPChannel#createConnection due to
> this issue. After "debugcontroltest.stop_time" ms, this program release
> the waiting by sending quit to jdb which is stopping the destination
> server. Finally, return 2.
>
> =Solution=
> Set timeout by using property-configured value:
> sun.rmi.transport.tcp.responseTimeout.
>
> My patch is below.
> http://icedtea.classpath.org/people/ykubota/fixLoopAtJMXConnectorFactory/file/e31044f0804f/jdk9.patch
>
> If you run the test program with modified JDK9 by my patch, the test
> program will get java.net.SocketTimeoutException after the connection
> timeout happen, then return 0.
>
> Thanks,
> Yuji.
>
>
> 2016-01-13 23:31 GMT+09:00 KUBOTA Yuji <kubota.yuji at gmail.com>:
>> Hi all,
>>
>> Can somebody please review and sponsor this fix ?
>>
>> Thanks,
>> Yuji
>>
>> 2016-01-05 17:56 GMT+09:00 KUBOTA Yuji <kubota.yuji at gmail.com>:
>>> Hi Jaroslav and core-libs-dev,
>>>
>>> Thank Jaroslav for your kindness!
>>>
>>> For core-libs-dev members, links the information about this issue.
>>>
>>> * details of problem
>>> http://mail.openjdk.java.net/pipermail/jdk9-dev/2015-April/002152.html
>>>
>>> * patch
>>> http://icedtea.classpath.org/people/ykubota/fixLoopAtJMXConnectorFactory/file/e31044f0804f/jdk9.patch
>>>
>>> * testcase for reproduce
>>> http://icedtea.classpath.org/people/ykubota/fixLoopAtJMXConnectorFactory/file/e31044f0804f/testProgram
>>> http://mail.openjdk.java.net/pipermail/serviceability-dev/2015-December/018415.html
>>>
>>> Could you please review these reports?
>>> Hope this patch helps to community.
>>>
>>> Thanks,
>>> Yuji
>>>
>>> 2016-01-04 23:51 GMT+09:00 Jaroslav Bachorik <jaroslav.bachorik at oracle.com>:
>>>> Hi Yuji,
>>>>
>>>> On 4.1.2016 15:14, KUBOTA Yuji wrote:
>>>>> Hi all,
>>>>>
>>>>> Could you please review this patch?
>>>>
>>>> Sorry for the long delay. Shanliang has not been present for some time and
>>>> probably this slipped the attention of the others.
>>>>
>>>> However, core-libs mailing list might be more appropriate place to review
>>>> this change since you are dealing with s.r.t.t.TCPChannel
>>>> (http://icedtea.classpath.org/people/ykubota/fixLoopAtJMXConnectorFactory/file/e31044f0804f/jdk9.patch)
>>>>
>>>> Regards,
>>>>
>>>> -JB-
More information about the core-libs-dev
mailing list