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 07:43:08 UTC

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

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



##########
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:
       Now that we have the `writeSet.recycle();` block above we could go back to compareAndSet()
   
   What about this ?
   
   ```
   if (complete.compareAndSet(false, true)) {
      writeSet.recycle();
   }
   ```
   
   This way:
   - we do writeSet.recycle(); only if complete is "false"
   - eventually complete will be "true" in any case
   
   




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