-
Bug
-
Resolution: Fixed
-
P2
-
6
-
b55
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2127928 | 5.0u7 | Shanliang Jiang | P2 | Resolved | Fixed | b01 |
The locking protocol used in javax.management.remote.rmi.RMIConnector is susceptible to deadlock. The particular deadlock observed is this:
"ClientNotifForwarder-6":
at javax.management.remote.rmi.RMIConnector.close(RMIConnector.java:407)
- waiting to lock <0xf102ceb8> (a javax.management.remote.rmi.RMIConnector)
at javax.management.remote.rmi.RMIConnector$RMIClientCommunicatorAdmin.gotIOException(RMIConnector.java:1442)
- locked <0xf0f22ac0> (a [I)
at javax.management.remote.rmi.RMIConnector$RMINotifClient.fetchNotifs(RMIConnector.java:1294)
at com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.fetchNotifs(ClientNotifForwarder.java:508)
at com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.run(ClientNotifForwarder.java:399)
at com.sun.jmx.remote.internal.ClientNotifForwarder$LinearExecutor$1.run(ClientNotifForwarder.java:83)
"main":
at javax.management.remote.rmi.RMIConnector.close(RMIConnector.java:412)
- waiting to lock <0xf0f22ac0> (a [I)
- locked <0xf102ceb8> (a javax.management.remote.rmi.RMIConnector)
at Client2.closeConnectors2(Client2.java:45)
at Client2.main(Client2.java:171)
RMIConnector.close() is synchronized and contains a block "synchronized(terminationLock)". When it is called by user code it therefore takes the locks in the order RMIConnector.this->terminationLock. On the other hand, RMIConnector.RMIClientCommunicatorAdmin.gotIOException calls RMIConnector.close() from with a "synchronized(terminationLock)" block. So it takes the locks in the order terminationLock->RMIConnector.this[->terminationLock]. This can lead to deadlock as has been observed by the customer.
###@###.### 2005-07-13 14:39:20 GMT
"ClientNotifForwarder-6":
at javax.management.remote.rmi.RMIConnector.close(RMIConnector.java:407)
- waiting to lock <0xf102ceb8> (a javax.management.remote.rmi.RMIConnector)
at javax.management.remote.rmi.RMIConnector$RMIClientCommunicatorAdmin.gotIOException(RMIConnector.java:1442)
- locked <0xf0f22ac0> (a [I)
at javax.management.remote.rmi.RMIConnector$RMINotifClient.fetchNotifs(RMIConnector.java:1294)
at com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.fetchNotifs(ClientNotifForwarder.java:508)
at com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.run(ClientNotifForwarder.java:399)
at com.sun.jmx.remote.internal.ClientNotifForwarder$LinearExecutor$1.run(ClientNotifForwarder.java:83)
"main":
at javax.management.remote.rmi.RMIConnector.close(RMIConnector.java:412)
- waiting to lock <0xf0f22ac0> (a [I)
- locked <0xf102ceb8> (a javax.management.remote.rmi.RMIConnector)
at Client2.closeConnectors2(Client2.java:45)
at Client2.main(Client2.java:171)
RMIConnector.close() is synchronized and contains a block "synchronized(terminationLock)". When it is called by user code it therefore takes the locks in the order RMIConnector.this->terminationLock. On the other hand, RMIConnector.RMIClientCommunicatorAdmin.gotIOException calls RMIConnector.close() from with a "synchronized(terminationLock)" block. So it takes the locks in the order terminationLock->RMIConnector.this[->terminationLock]. This can lead to deadlock as has been observed by the customer.
###@###.### 2005-07-13 14:39:20 GMT
- backported by
-
JDK-2127928 Deadlock in RMIConnector.close
-
- Resolved
-
- relates to
-
JDK-6431704 Deadlock in RMIConnector.close
-
- Resolved
-