From c2ad54fa917a92ee8acfe701be9201ce30baa1fa Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 26 Apr 2023 00:28:10 -0400 Subject: [PATCH] ARTEMIS-4247 Fixing BrokerInSyncTest::testExpiryNoReaper Once the context is set to disable mirror, it should stay that way even if reset is called. --- .../artemis/core/server/impl/RoutingContextImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java index 8373bc2586..d4bcfcebe5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java @@ -167,7 +167,12 @@ public class RoutingContextImpl implements RoutingContext { this.internalOnly = null; - mirrorOption = MirrorOption.enabled; + // once we set to disabled, we keep it always disabled. + // This is because the routing object used to route commands will disable this + // and it should stay that way no matter what + if (mirrorOption != MirrorOption.disabled) { + mirrorOption = MirrorOption.enabled; + } return this; }