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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]