You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2022/04/08 15:22:49 UTC

[GitHub] [jackrabbit-oak] thomasmueller commented on a diff in pull request #538: OAK-9748 Parallel Merge does not handle download retry correctly

thomasmueller commented on code in PR #538:
URL: https://github.com/apache/jackrabbit-oak/pull/538#discussion_r846241402


##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/MergeRunner.java:
##########
@@ -254,6 +274,14 @@ public void run() {
             }
         }
         log.info("Waiting for batch sorting tasks completion");
+
+        // Parent thread signals to stop immediately
+        if (unmergedFiles.contains(MERGE_FORCE_STOP_POISON_PILL)) {
+            log.info("Merger receives force stop signal, shutting down all merge tasks");
+            executorService.shutdownNow();

Review Comment:
   This cancels tasks via Thread.interrupt(), which is very problematic: is closes all open files and sockets, and this can cause issues. See also https://stackoverflow.com/questions/2020992/is-thread-interrupt-evil#:~:text=The%20main%20problem%20with%20Thread,interrupt%20the%20thread%20right%20away. - and we had issues in Oak and AEM as well. 
   
   In my view, we must not use shutdownNow here.



##########
oak-run-commons/src/test/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/FlatFileStoreTest.java:
##########
@@ -49,8 +49,8 @@
 import static java.util.Arrays.asList;
 import static java.util.Collections.singleton;
 import static org.apache.jackrabbit.oak.index.indexer.document.flatfile.FlatFileNodeStoreBuilder.OAK_INDEXER_SORT_STRATEGY_TYPE;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.apache.jackrabbit.oak.index.indexer.document.flatfile.FlatFileNodeStoreBuilder.PROP_MERGE_TASK_BATCH_SIZE;
+import static org.junit.Assert.*;

Review Comment:
   Please don't use star imports.



-- 
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: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org