rishabhdaim commented on code in PR #2780:
URL: https://github.com/apache/jackrabbit-oak/pull/2780#discussion_r2894800223


##########
oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentBufferWriterPool.java:
##########
@@ -225,20 +232,29 @@ public void flush(@NotNull SegmentStore store) throws 
IOException {
                 toReturn.addAll(borrowed);
                 borrowed.clear();
             } finally {
-                poolMonitor.leave();
+                lock.unlock();
             }
 
             // Wait for the return of the borrowed writers. This is the
             // case once all of them appear in the disposed set.
-            if (safeEnterWhen(poolMonitor, allReturned(toReturn))) {
-                try {
+            lock.lock();
+            try {

Review Comment:
   this has to block till are writer have been returned. i.e. what 
`safeEnterWhen` was doing internally



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

Reply via email to