dlg99 commented on a change in pull request #3110:
URL: https://github.com/apache/bookkeeper/pull/3110#discussion_r829298157



##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingReadOp.java
##########
@@ -110,6 +110,7 @@
 
         @Override
         public void close() {
+            complete.set(true);

Review comment:
       @congbobo184 with this approach we risk calling recycle twice if close() 
is called from different threads. 
   At least we need to implement @eolivelli 's suggestion. I'd set rc to 
something as well, eg:
   
   ```
           @Override
           public void close() {
               if (complete.compareAndSet(false, true)) {
                  rc = BKException.Code.UnexpectedConditionException;
                  writeSet.recycle();
               }
               entryImpl.close();
           }
   ```




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