You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by "brusdev (via GitHub)" <gi...@apache.org> on 2023/06/26 06:35:54 UTC
[GitHub] [activemq-artemis] brusdev opened a new pull request, #4526: Close stuck sessions
brusdev opened a new pull request, #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526
ARTEMIS-4332 Add management method to close stuck server sessions
In rare cases a store operation could silently fails or starves, blocking the related server session and all delivering messages. Those server sessions can be closed adding a management method that cleans their operation context before closing them.
This PR also includes an optional commit to track store operations that would help to analyze heap dumps with stuck server sessions: ARTEMIS-4332 Add store operation trackers
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] brusdev commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "brusdev (via GitHub)" <gi...@apache.org>.
brusdev commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1256039927
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java:
##########
@@ -104,6 +107,29 @@ public static void setContext(final OperationContext context) {
private final Executor executor;
+ public static final String MAX_STORE_OPERATION_TRACKERS_PROP = "artemis.maxStoreOperationTrackers";
+
+ private static int maxStoreOperationTrackers = -1;
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] brusdev commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "brusdev (via GitHub)" <gi...@apache.org>.
brusdev commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1247948976
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java:
##########
@@ -415,4 +449,27 @@ public String toString() {
executorsPendingField +
"]";
}
+
+ @Override
+ public void clear() {
+ stored = 0;
+ storeLineUpField = 0;
+ minimalReplicated = 0;
+ replicated = 0;
+ replicationLineUpField = 0;
+ paged = 0;
+ minimalPage = 0;
+ pageLineUpField = 0;
+ errorCode = -1;
+ errorMessage = null;
+ executorsPendingField = 0;
+
+ if (tasks != null) {
+ tasks.clear();
+ }
+
+ if (storeOnlyTasks != null) {
+ storeOnlyTasks.clear();
+ }
Review Comment:
The potential consequences of corrupting should only be related to the closing session itself and its context but I see your point I'll change it to be thread-safe.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] brusdev commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "brusdev (via GitHub)" <gi...@apache.org>.
brusdev commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1256038651
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java:
##########
@@ -104,6 +110,24 @@ public static void setContext(final OperationContext context) {
private final Executor executor;
+ private static int maxDebugTrackers = Integer.parseInt(
+ System.getProperty("ARTEMIS_OPCONTEXT_MAX_DEBUG_TRACKERS", "0"));
+
+ private Buffer debugTrackers = OperationContextImpl.maxDebugTrackers > 0 ?
+ BufferUtils.synchronizedBuffer(new CircularFifoBuffer(OperationContextImpl.maxDebugTrackers)) : null;
+
+ public static int getMaxDebugTrackers() {
+ return OperationContextImpl.maxDebugTrackers;
+ }
+
+ public static void setMaxDebugTrackers(int maxDebugTrackers) {
Review Comment:
done
##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextUnitTest.java:
##########
@@ -422,4 +422,43 @@ public void onError(final int errorCode, final String errorMessage) {
Assert.assertEquals(0, operations.get());
}
+ @Test
+ public void testContextWithoutDebugTrackers() {
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
+
+ Assert.assertEquals(0, OperationContextImpl.getMaxDebugTrackers());
+ OperationContextImpl context = new OperationContextImpl(executor);
+ Assert.assertNull(context.getDebugTrackers());
+
+ context.storeLineUp();
+ Assert.assertNull(context.getDebugTrackers());
+
+ context.done();
+ Assert.assertNull(context.getDebugTrackers());
+ }
+
+ @Test
+ public void testContextWithDebugTrackers() {
+ int maxStoreOperationTrackers = OperationContextImpl.getMaxDebugTrackers();
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] clebertsuconic commented on pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#issuecomment-1634263740
@brusdev only thing I could ask now is to verify if the new test over Core is failing in a loop or not? We had a few overCore tests failing in management because of noise from the Core itself (the testing framework itself is creating a connection and a session in the server's).
Other than that I think we should merge this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] gemmellr commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "gemmellr (via GitHub)" <gi...@apache.org>.
gemmellr commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1245342785
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java:
##########
@@ -415,4 +449,27 @@ public String toString() {
executorsPendingField +
"]";
}
+
+ @Override
+ public void clear() {
+ stored = 0;
+ storeLineUpField = 0;
+ minimalReplicated = 0;
+ replicated = 0;
+ replicationLineUpField = 0;
+ paged = 0;
+ minimalPage = 0;
+ pageLineUpField = 0;
+ errorCode = -1;
+ errorMessage = null;
+ executorsPendingField = 0;
+
+ if (tasks != null) {
+ tasks.clear();
+ }
+
+ if (storeOnlyTasks != null) {
+ storeOnlyTasks.clear();
+ }
Review Comment:
So I guess the question is really just, what are the potential consequences of corrupting the list and is it important?
Closing 'stuck' sessions is what the method is being added for, but its not necessarily when it will actually be called. I expect some folks will use the 'force' just because it exists at all, to avoid having to think whether they actually need it or not. E.g the same way folks use rm -rf a lot of the time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] clebertsuconic commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1256028418
##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextUnitTest.java:
##########
@@ -422,4 +422,43 @@ public void onError(final int errorCode, final String errorMessage) {
Assert.assertEquals(0, operations.get());
}
+ @Test
+ public void testContextWithoutDebugTrackers() {
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
Review Comment:
You are not shutting down this executor. it's leaking a thread.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] clebertsuconic commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1256029212
##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextUnitTest.java:
##########
@@ -422,4 +422,43 @@ public void onError(final int errorCode, final String errorMessage) {
Assert.assertEquals(0, operations.get());
}
+ @Test
+ public void testContextWithoutDebugTrackers() {
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
Review Comment:
add a runAfter(executor::shutdownNow);
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] brusdev commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "brusdev (via GitHub)" <gi...@apache.org>.
brusdev commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1256038327
##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextUnitTest.java:
##########
@@ -422,4 +422,43 @@ public void onError(final int errorCode, final String errorMessage) {
Assert.assertEquals(0, operations.get());
}
+ @Test
+ public void testContextWithoutDebugTrackers() {
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] gemmellr commented on a diff in pull request #4526: Close stuck sessions
Posted by "gemmellr (via GitHub)" <gi...@apache.org>.
gemmellr commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1244935699
##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextUnitTest.java:
##########
@@ -422,4 +422,37 @@ public void onError(final int errorCode, final String errorMessage) {
Assert.assertEquals(0, operations.get());
}
+ @Test
+ public void testContextWithoutStoreOperationTrackers() {
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
+
+ OperationContextImpl.setMaxStoreOperationTrackers(0);
+ OperationContextImpl context = new OperationContextImpl(executor);
+ Assert.assertNull(context.getStoreOperationTrackers());
+
+ context.storeLineUp();
+ Assert.assertNull(context.getStoreOperationTrackers());
+
+ context.done();
+ Assert.assertNull(context.getStoreOperationTrackers());
+ }
+
+ @Test
+ public void testContextWithStoreOperationTrackers() {
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
+
+ OperationContextImpl.setMaxStoreOperationTrackers(1);
Review Comment:
This sets a static, but it doesnt seem like it is reset later, so does it remain set for all subsequent tests?
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java:
##########
@@ -415,4 +449,27 @@ public String toString() {
executorsPendingField +
"]";
}
+
+ @Override
+ public void clear() {
+ stored = 0;
+ storeLineUpField = 0;
+ minimalReplicated = 0;
+ replicated = 0;
+ replicationLineUpField = 0;
+ paged = 0;
+ minimalPage = 0;
+ pageLineUpField = 0;
+ errorCode = -1;
+ errorMessage = null;
+ executorsPendingField = 0;
+
+ if (tasks != null) {
+ tasks.clear();
+ }
+
+ if (storeOnlyTasks != null) {
+ storeOnlyTasks.clear();
+ }
Review Comment:
These lists are not thread-safe, and this could potentially be a concurrent operation (people can tend to use 'force' toggles even if they dont actually need to). Was this method meant to be synchronized, or did you not want to synchronize it (although setting the other fields also wont really be safe without doing so..) ? If the latter do they need changed to a concurrent structure, or is it ok they may get corrupted in this scenario?
##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextUnitTest.java:
##########
@@ -422,4 +422,37 @@ public void onError(final int errorCode, final String errorMessage) {
Assert.assertEquals(0, operations.get());
}
+ @Test
+ public void testContextWithoutStoreOperationTrackers() {
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
+
+ OperationContextImpl.setMaxStoreOperationTrackers(0);
Review Comment:
Rather than set it 0, could it just verify it is 0, i.e test the default?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] clebertsuconic commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1254532745
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java:
##########
@@ -104,6 +107,29 @@ public static void setContext(final OperationContext context) {
private final Executor executor;
+ public static final String MAX_STORE_OPERATION_TRACKERS_PROP = "artemis.maxStoreOperationTrackers";
+
+ private static int maxStoreOperationTrackers = -1;
Review Comment:
- I think this should be final
and it should be initialized with a static initializer, or simply use the System.getProperty straight away.
{
}
- Also the property name. and the pattern used here.
RefCountMessage used a different pattern. I think we should stick to the same pattern used in there.
ARTEMIS_
and maxStoreOperationsTrackers.. it doesn't not really translate to anything unless I read the code and understand what is doing.
I'm not sure what better name we could use (I'm terrible with names). but what about:
ARTEMIS_OPCONTEXT_TRACKER_NUMBER?
And some javadoc of what it does?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] clebertsuconic commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1256030195
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java:
##########
@@ -104,6 +110,24 @@ public static void setContext(final OperationContext context) {
private final Executor executor;
+ private static int maxDebugTrackers = Integer.parseInt(
+ System.getProperty("ARTEMIS_OPCONTEXT_MAX_DEBUG_TRACKERS", "0"));
+
+ private Buffer debugTrackers = OperationContextImpl.maxDebugTrackers > 0 ?
+ BufferUtils.synchronizedBuffer(new CircularFifoBuffer(OperationContextImpl.maxDebugTrackers)) : null;
+
+ public static int getMaxDebugTrackers() {
+ return OperationContextImpl.maxDebugTrackers;
+ }
+
+ public static void setMaxDebugTrackers(int maxDebugTrackers) {
Review Comment:
no need to be public, the test is the same package I think
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] brusdev commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "brusdev (via GitHub)" <gi...@apache.org>.
brusdev commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1245062445
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java:
##########
@@ -415,4 +449,27 @@ public String toString() {
executorsPendingField +
"]";
}
+
+ @Override
+ public void clear() {
+ stored = 0;
+ storeLineUpField = 0;
+ minimalReplicated = 0;
+ replicated = 0;
+ replicationLineUpField = 0;
+ paged = 0;
+ minimalPage = 0;
+ pageLineUpField = 0;
+ errorCode = -1;
+ errorMessage = null;
+ executorsPendingField = 0;
+
+ if (tasks != null) {
+ tasks.clear();
+ }
+
+ if (storeOnlyTasks != null) {
+ storeOnlyTasks.clear();
+ }
Review Comment:
@gemmellr yes this could potentially be a concurrent operation and it could cause inconsistent state. I could change it to be thread-safe but I'm not sure this is necessary. I mean this method should be the last chance to close a stuck session and it is supposed to be manually called by a user. If the call is successful the context/session will be closed otherwise users could retry.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] gemmellr commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "gemmellr (via GitHub)" <gi...@apache.org>.
gemmellr commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1250632007
##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextUnitTest.java:
##########
@@ -422,4 +422,43 @@ public void onError(final int errorCode, final String errorMessage) {
Assert.assertEquals(0, operations.get());
}
+ @Test
+ public void testContextWithoutStoreOperationTrackers() {
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
+
+ OperationContextImpl.resetMaxStoreOperationTrackers();
Review Comment:
Slight nitpick but I think it would be better if it didnt do this reset first, and so verified the default behaviour was as expected?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] brusdev commented on pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "brusdev (via GitHub)" <gi...@apache.org>.
brusdev commented on PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#issuecomment-1618590974
@gemmellr thanks for your review
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] clebertsuconic merged pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic merged PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] brusdev commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "brusdev (via GitHub)" <gi...@apache.org>.
brusdev commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1254609777
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java:
##########
@@ -104,6 +107,29 @@ public static void setContext(final OperationContext context) {
private final Executor executor;
+ public static final String MAX_STORE_OPERATION_TRACKERS_PROP = "artemis.maxStoreOperationTrackers";
+
+ private static int maxStoreOperationTrackers = -1;
Review Comment:
What about `ARTEMIS_OPCONTEXT_MAX_DEBUG_TRACKERS`/`maxDebugTrackers` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [activemq-artemis] clebertsuconic commented on a diff in pull request #4526: ARTEMIS-4332 Add management method to close stuck server sessions
Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #4526:
URL: https://github.com/apache/activemq-artemis/pull/4526#discussion_r1256029556
##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextUnitTest.java:
##########
@@ -422,4 +422,43 @@ public void onError(final int errorCode, final String errorMessage) {
Assert.assertEquals(0, operations.get());
}
+ @Test
+ public void testContextWithoutDebugTrackers() {
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
+
+ Assert.assertEquals(0, OperationContextImpl.getMaxDebugTrackers());
+ OperationContextImpl context = new OperationContextImpl(executor);
+ Assert.assertNull(context.getDebugTrackers());
+
+ context.storeLineUp();
+ Assert.assertNull(context.getDebugTrackers());
+
+ context.done();
+ Assert.assertNull(context.getDebugTrackers());
+ }
+
+ @Test
+ public void testContextWithDebugTrackers() {
+ int maxStoreOperationTrackers = OperationContextImpl.getMaxDebugTrackers();
+ ExecutorService executor = Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName()));
Review Comment:
runAfter(executor::shutdownDown);
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org