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 2021/10/13 07:57:44 UTC

[GitHub] [jackrabbit-oak] averma21 commented on a change in pull request #383: OAK-9576: Multithreaded download synchronization issues

averma21 commented on a change in pull request #383:
URL: https://github.com/apache/jackrabbit-oak/pull/383#discussion_r727798177



##########
File path: oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/StoreAndSortStrategy.java
##########
@@ -62,8 +63,12 @@ public StoreAndSortStrategy(Iterable<NodeStateEntry> nodeStates, PathElementComp
 
     @Override
     public File createSortedStoreFile() throws IOException {
-        File storeFile = writeToStore(storeDir, getStoreFileName());
-        return sortStoreFile(storeFile);
+        try {
+            File storeFile = writeToStore(storeDir, getStoreFileName());
+            return sortStoreFile(storeFile);
+        } finally {
+            nodeStates.close();

Review comment:
       yes, this looks weird since this class is not the owner of nodeStates. This has been done to prevent OOM for multi threaded download. We need to keep on closing the nodeStates as the download tasks keep on finishing. This is mainly for TraverseAndSortTask (tasks created for parallel download) but due to code flow same pattern had to be followed here.
   We could improve this but some more refactoring would be needed.




-- 
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