You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/03/17 17:13:47 UTC

[GitHub] [bookkeeper] dlg99 commented on a change in pull request #3110: PendingReadOp: Fix ledgerEntryImpl reuse problem

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:
   
   ```
   if (complete.compareAndSet(false, true)) {
      rc = BKException.Code.UnexpectedConditionException;
      writeSet.recycle();
   }
   ```




-- 
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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org