qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1711301 - in /qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport: NetworkConnectionScheduler.java SelectorThread.java
Date Thu, 29 Oct 2015 16:59:45 GMT
Author: rgodfrey
Date: Thu Oct 29 16:59:45 2015
New Revision: 1711301

URL: http://svn.apache.org/viewvc?rev=1711301&view=rev
Log:
QPID-6794 : Ensure connection is always added back to the selector it is currently assigned
to - otherwise connections are assigned to all selectors, and deadlocks can occur

Modified:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java?rev=1711301&r1=1711300&r2=1711301&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
(original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
Thu Oct 29 16:59:45 2015
@@ -134,7 +134,7 @@ public class NetworkConnectionScheduler
                         }
                         else
                         {
-                            _selectorThread.addConnection(connection);
+                            _selectorThread.returnConnectionToSelector(connection);
                         }
                     }
                 }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java?rev=1711301&r1=1711300&r2=1711301&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
(original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
Thu Oct 29 16:59:45 2015
@@ -490,6 +490,21 @@ class SelectorThread extends Thread
 
     }
 
+    public void returnConnectionToSelector(final NonBlockingConnection connection)
+    {
+        if(selectionInterestRequiresUpdate(connection))
+        {
+            SelectionTask selectionTask = connection.getSelectionTask();
+            if(selectionTask == null)
+            {
+                throw new IllegalStateException("returnConnectionToSelector should only be
called with connections that are currently assigned a selector task");
+            }
+            selectionTask.getUnregisteredConnections().add(connection);
+            selectionTask.wakeup();
+        }
+
+    }
+
     private SelectionTask getNextSelectionTask()
     {
         int index;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message