brusdev commented on code in PR #5952:
URL: https://github.com/apache/activemq-artemis/pull/5952#discussion_r2406023724


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java:
##########
@@ -1787,27 +1793,34 @@ public void close(final boolean failed, final boolean 
force) {
          context.reset();
       }
 
+      final ScheduledFuture<?> scheduledFuture = 
server.getScheduledPool().schedule(() -> {
+         callDoClose(failed);
+         logger.warn(ThreadDumpUtil.threadDump("Timed out closing session"));

Review Comment:
   Can we add more info, i.e. the timeout value, the pending consumers, the 
pending transaction ID?
   ```
   Closing session <this.name> with <conumsers.size()> consumers and 
transaction <tx> after <timeoutSessionClose> milliseconds
   ```
   
   Can we write the log before calling callDoClose?



##########
tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/JournalImplTestUnit.java:
##########
@@ -83,6 +90,46 @@ public void testAddUpdateDeleteManyLargeFileSize() throws 
Exception {
 
    }
 
+
+   @Test
+   public void testCommitOnError() throws Exception {
+      ExecutorService executorService = Executors.newSingleThreadExecutor();
+      runAfter(executorService::shutdownNow);
+      setup(10, 10 * 1024 * 1024, true);
+      createJournal();
+      startJournal();
+      load();
+      addTx(1, 1L);
+      ((JournalImpl)journal).markTXError(1, new Exception("test"));
+      OperationContextImpl context = new OperationContextImpl(executorService);
+      try {
+         journal.appendCommitRecord(1, true, context);

Review Comment:
   Can we enforce the check of appendCommitRecord?
   
   ```suggestion
            journal.appendCommitRecord(1, true, context);
            fail("should throw exception")
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to