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/11/01 10:49:48 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_r740121152



##########
File path: oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/TraverseAndSortTask.java
##########
@@ -263,15 +269,21 @@ private synchronized void reset() {
     }
 
     private void sortAndSaveBatch() throws IOException {
-        if (entryBatch.isEmpty()) {
-            return;
+        synchronized (this) {
+            if (entryBatch.isEmpty()) {
+                return;
+            }
+            entryBatch.sort(comparator);
         }
-        entryBatch.sort(comparator);
         Stopwatch w = Stopwatch.createStarted();
         File newtmpfile = File.createTempFile("sortInBatch", "flatfile", sortWorkDir);
         long textSize = 0;
+        long size = entryBatch.size();

Review comment:
       Removed synchronization.




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