8038940: c.s.j.r.i.ClientNotifForwarder$LinearExecutor
authorsjiang
Wed, 02 Apr 2014 14:57:17 +0200
changeset 23706 5ea287e13cdb
parent 23705 6dbe0ae69dc3
child 23707 4580f737d5b9
8038940: c.s.j.r.i.ClientNotifForwarder$LinearExecutor Reviewed-by: dfuchs, jbachorik
jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java
--- a/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java	Wed Apr 02 12:20:01 2014 +0000
+++ b/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java	Wed Apr 02 14:57:17 2014 +0200
@@ -787,6 +787,14 @@
             if (!reconnected) {
                 try {
                     NotificationResult nr = fetchNotifs(-1, 0, 0);
+
+                    if (state != STOPPED) { // JDK-8038940
+                                            // reconnection must happen during
+                                            // fetchNotifs(-1, 0, 0), and a new
+                                            // thread takes over the fetching job
+                        return;
+                    }
+
                     clientSequenceNumber = nr.getNextSequenceNumber();
                 } catch (ClassNotFoundException e) {
                     // can't happen