activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject [1/2] activemq git commit: https://issues.apache.org/jira/browse/AMQ-6275
Date Thu, 09 Jun 2016 21:33:46 GMT
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.13.x 539d6b747 -> f471b51c2


https://issues.apache.org/jira/browse/AMQ-6275

Avoid unnecessary connection state lookup leading to lock ordering
issues.
(cherry picked from commit 98d20008333af380ae05d91036d123501115ab8c)


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/d594248d
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/d594248d
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/d594248d

Branch: refs/heads/activemq-5.13.x
Commit: d594248db59995432cdbf8b1866590e1cd8d814e
Parents: 539d6b7
Author: Timothy Bish <tabish121@gmail.com>
Authored: Thu Jun 9 12:09:42 2016 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Thu Jun 9 12:10:47 2016 -0400

----------------------------------------------------------------------
 .../org/apache/activemq/broker/TransportConnection.java     | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/d594248d/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
index 2727503..350f529 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
@@ -671,7 +671,7 @@ public class TransportConnection implements Connection, Task, CommandVisitor
{
             broker.addConsumer(cs.getContext(), info);
             try {
                 ss.addConsumer(info);
-                addConsumerBrokerExchange(info.getConsumerId());
+                addConsumerBrokerExchange(cs, info.getConsumerId());
             } catch (IllegalStateException e) {
                 broker.removeConsumer(cs.getContext(), info);
             }
@@ -1513,15 +1513,14 @@ public class TransportConnection implements Connection, Task, CommandVisitor
{
         return result;
     }
 
-    private ConsumerBrokerExchange addConsumerBrokerExchange(ConsumerId id) {
+    private ConsumerBrokerExchange addConsumerBrokerExchange(TransportConnectionState connectionState,
ConsumerId id) {
         ConsumerBrokerExchange result = consumerExchanges.get(id);
         if (result == null) {
             synchronized (consumerExchanges) {
                 result = new ConsumerBrokerExchange();
-                TransportConnectionState state = lookupConnectionState(id);
-                context = state.getContext();
+                context = connectionState.getContext();
                 result.setConnectionContext(context);
-                SessionState ss = state.getSessionState(id.getParentId());
+                SessionState ss = connectionState.getSessionState(id.getParentId());
                 if (ss != null) {
                     ConsumerState cs = ss.getConsumerState(id);
                     if (cs != null) {


Mime
View raw message