Repository: activemq-artemis Updated Branches: refs/heads/master 7d9d3086a -> eb75a69bc
ARTEMIS-459 NPE during RA tearDown Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/9c840bde Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/9c840bde Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/9c840bde Branch: refs/heads/master Commit: 9c840bdeb8107ce1570c3f5d7cabd6edb37356b0 Parents: 7d9d308 Author: jbertram <[email protected]> Authored: Tue Apr 26 09:59:43 2016 -0500 Committer: Clebert Suconic <[email protected]> Committed: Tue Apr 26 21:33:19 2016 -0400 ---------------------------------------------------------------------- .../apache/activemq/artemis/ra/inflow/ActiveMQActivation.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9c840bde/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java index f42db64..510e680 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java @@ -42,6 +42,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQExceptionType; import org.apache.activemq.artemis.api.core.ActiveMQNonExistentQueueException; import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException; import org.apache.activemq.artemis.api.core.SimpleString; +import org.apache.activemq.artemis.api.core.client.ActiveMQClient; import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ClusterTopologyListener; @@ -360,6 +361,8 @@ public class ActiveMQActivation { protected synchronized void teardown() { ActiveMQRALogger.LOGGER.debug("Tearing down " + spec); + long timeout = factory == null ? ActiveMQClient.DEFAULT_CALL_TIMEOUT : factory.getCallTimeout(); + if (resourceRecovery != null) { ra.getRecoveryManager().unRegister(resourceRecovery); } @@ -385,7 +388,7 @@ public class ActiveMQActivation { } //wait for all the consumers to complete any onmessage calls - boolean stuckThreads = !future.await(factory.getCallTimeout()); + boolean stuckThreads = !future.await(timeout); //if any are stuck then we need to interrupt them if (stuckThreads) { for (Thread interruptThread : interruptThreads) { @@ -413,7 +416,7 @@ public class ActiveMQActivation { threadTearDown.start(); try { - threadTearDown.join(factory.getCallTimeout()); + threadTearDown.join(timeout); } catch (InterruptedException e) { // nothing to be done on this context.. we will just keep going as we need to send an interrupt to threadTearDown and give up
