[ 
https://issues.apache.org/jira/browse/ARTEMIS-2415?focusedWorklogId=280077&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-280077
 ]

ASF GitHub Bot logged work on ARTEMIS-2415:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Jul/19 09:47
            Start Date: 20/Jul/19 09:47
    Worklog Time Spent: 10m 
      Work Description: brusdev commented on pull request #2741: ARTEMIS-2415 
JDBCJournal miss pending tasks during shutdown
URL: https://github.com/apache/activemq-artemis/pull/2741#discussion_r305574631
 
 

 ##########
 File path: 
artemis-server/src/test/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManagerTest.java
 ##########
 @@ -212,4 +212,36 @@ public void 
testAddBytesToLargeMessageNotLeakingByteBuffer() throws Exception {
       }
    }
 
+   @Test
+   public void testDeletingLargeMessagePendingTasksOnShutdown() throws 
Exception {
+      if (journalType == JournalType.ASYNCIO) {
+         assumeTrue("AIO is not supported on this platform", 
AIOSequentialFileFactory.isSupported());
+      }
+      final Configuration configuration = 
createDefaultInVMConfig().setJournalType(journalType);
+      final ExecutorFactory executorFactory = new 
OrderedExecutorFactory(executor);
+      final ExecutorFactory ioExecutorFactory = new 
OrderedExecutorFactory(ioExecutor);
+      final JournalStorageManager manager = new 
JournalStorageManager(configuration, null, executorFactory, null, 
ioExecutorFactory);
+      manager.start();
+      manager.loadBindingJournal(new ArrayList<>(), new ArrayList<>(), new 
ArrayList<>());
+      final PostOffice postOffice = mock(PostOffice.class);
+      final JournalLoader journalLoader = mock(JournalLoader.class);
+      manager.loadMessageJournal(postOffice, null, null, null, null, null, 
null, journalLoader);
+      final LargeServerMessage largeMessage = 
manager.createLargeMessage(manager.generateID() + 1, new 
CoreMessage().setDurable(true));
+      final SequentialFile file = largeMessage.getFile();
+      manager.getContext(true).storeLineUp();
+      manager.deleteLargeMessageFile(largeMessage);
+      final CountDownLatch latch = new CountDownLatch(1);
+      Executors.newSingleThreadExecutor().execute(() -> {
+         try {
+            manager.stop();
+            latch.countDown();
+         } catch (Exception ignore) {
+         }
+      });
+      Thread.sleep(500);
 
 Review comment:
   I replaced the sleep with a latch and a wait. 
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 280077)
    Time Spent: 1h 20m  (was: 1h 10m)

> JDBCJournal miss pending tasks during shutdown
> ----------------------------------------------
>
>                 Key: ARTEMIS-2415
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2415
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Domenico Bruscino
>            Priority: Major
>         Attachments: 
> downstream_run_16.filtered_testRegularMessagePersistenceDelayedConsumer.log
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> If server stops while having pending tasks in OperationContextImpl forĀ 
> JDBCJournal, server omits this tasks and prints a bunch of exceptions in the 
> log, not exiting cleanly.
> Log of the situation from the test run is attached.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to