From ddb67ccdb12829668c321b06c4c4349da722f4fb Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Thu, 26 Mar 2020 16:07:18 -0400 Subject: [PATCH] ARTEMIS-1975 Fixing deadlock after error processing --- .../apache/activemq/artemis/core/server/impl/QueueImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java index 9ce735d623..7d798b74ad 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java @@ -3615,6 +3615,10 @@ public class QueueImpl extends CriticalComponentImpl implements Queue { /** This will print errors and decide what to do with the errored consumer from the protocol layer. */ @Override public void errorProcessing(Consumer consumer, Throwable t, MessageReference reference) { + executor.execute(() -> errorProcessing(consumer, t, reference)); + } + + private void internalErrorProcessing(Consumer consumer, Throwable t, MessageReference reference) { synchronized (this) { ActiveMQServerLogger.LOGGER.removingBadConsumer(t, consumer, reference); // If the consumer throws an exception we remove the consumer