summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2015-03-03 16:20:07 +0000
committerKeith Wall <kwall@apache.org>2015-03-03 16:20:07 +0000
commite18a62658b67264548e5719466ecad8dd8505375 (patch)
treef09d57e6169958c0cb48fc9e4524b0cb6bab687a
parent11a201863b9c989151cf117450785504a61df5ce (diff)
downloadqpid-python-e18a62658b67264548e5719466ecad8dd8505375.tar.gz
Bug fix: Prevent NPE possibility if closing an object takes too long.
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-6262-JavaBrokerNIO@1663731 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java4
-rw-r--r--qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java3
2 files changed, 4 insertions, 3 deletions
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
index 76608cffbf..86d0b07e16 100644
--- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
@@ -2035,9 +2035,9 @@ public abstract class AbstractConfiguredObject<X extends ConfiguredObject<X>> im
}
remaining = startTime + timeout - System.currentTimeMillis();
- if(remaining < 0)
+ if(remaining <= 0)
{
- throw new TimeoutException("Completion did not occur within given tiemout: " + timeout);
+ throw new TimeoutException("Completion did not occur within given timeout: " + timeout);
}
}
}
diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
index 18ebc94187..2a1fbe6881 100644
--- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
+++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
@@ -1277,7 +1277,8 @@ public class AMQChannel
// stop all subscriptions
_rollingBack = true;
- boolean requiresSuspend = _suspended.compareAndSet(false,true);
+ boolean requiresSuspend = _suspended.compareAndSet(false,true); // TODO This is probably superfluous owing to the
+ // message assignment suspended logic in NBC.
// ensure all subscriptions have seen the change to the channel state
for(ConsumerTarget_0_8 sub : _tag2SubscriptionTargetMap.values())