Review Request: 7195779 javax/management/remote/mandatory/threads/ExecutorTest.java fail intermittently
Alan Bateman
Alan.Bateman at oracle.com
Wed Sep 19 06:06:05 PDT 2012
On 19/09/2012 13:39, Jaroslav Bachorik wrote:
> The ExecutorTest.java fails in cca. 30-40% of runs with NPE in the part
> testing IIOP connection.
>
> The failure is caused by the JMX notification processing - ideally, once
> the RMIConnector is closed the client JMX notification processing should
> quit as well and should not try to fetch any more notifications over the
> already closed remote connection. But achieving this is particularly
> difficult mostly due to the synchronous nature of the
> fetchNotifications() method. The RMIConnector can get closed after the
> fetchNotifications() method was entered but before attempting to invoke
> its remote counterpart. At this moment the remote connection is
> effectively closed and any attempt to use it will throw an exception - a
> NPE in this case.
>
> The patch does not solve the core problem as it would probably require
> significant changes in the client JMX notification processing - rather
> it targets the NPE which becomes expected when the RMIConnector is
> closed. This is handled by adding a new "catch (NullPointerException)"
> block and, inside that block, checking for the connection state and
> rethrowing the exception in case the connection is still open
> (RMIConnector is started). For any other state of RMIConnector the NPE
> is ignored.
>
> The webrev is located at: http://washi.ru.oracle.com/jb198685/webrev/7195779
>
This webrev looks to be Oracle internal so folks on this list will not
be able to look at it.
In any case, I'm not sure that catching the NPE is a good idea as it
seems to be masking the real problem. At the lower level then would it
be possible to have an IOException thrown if the connection is closed?
-Alan.
More information about the serviceability-dev
mailing list