Repository: qpid-jms Updated Branches: refs/heads/master d33ea1d54 -> 125d72b2a
QPIDJMS-45: move the cancellation into the executor so it occurs earlier, and additionally avoids a potential NPE Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/125d72b2 Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/125d72b2 Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/125d72b2 Branch: refs/heads/master Commit: 125d72b2a8b05ac7c8f9bbad599ed217107922f8 Parents: d33ea1d Author: Robert Gemmell <[email protected]> Authored: Tue May 12 15:48:05 2015 +0100 Committer: Robert Gemmell <[email protected]> Committed: Tue May 12 15:48:25 2015 +0100 ---------------------------------------------------------------------- .../org/apache/qpid/jms/provider/amqp/AmqpProvider.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/125d72b2/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java index ff560d1..6a1597d 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java @@ -190,6 +190,12 @@ public class AmqpProvider implements Provider, TransportListener { } } catch (Exception e) { LOG.debug("Caught exception while closing proton connection: {}", e.getMessage()); + } finally { + if (nextIdleTimeoutCheck != null) { + LOG.trace("Cancelling scheduled IdleTimeoutCheck"); + nextIdleTimeoutCheck.cancel(false); + nextIdleTimeoutCheck = null; + } } } }); @@ -211,11 +217,6 @@ public class AmqpProvider implements Provider, TransportListener { } } - if (nextIdleTimeoutCheck != null) { - LOG.trace("Cancelling IdleTimeoutCheck"); - nextIdleTimeoutCheck.cancel(false); - nextIdleTimeoutCheck = null; - } serializer.shutdown(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
