lhotari commented on pull request #3110:
URL: https://github.com/apache/bookkeeper/pull/3110#issuecomment-1068099040


   Thanks for the explanation @hangc0276 . I now understood how the race 
condition happens in 
`org.apache.bookkeeper.client.PendingReadOp#readEntryComplete` method and it 
answers my question.
   
   To prevent the problem I think that the current code needs revisiting. Why 
did @congbobo184 make this change: 7a1504ff8ee6140b4f63a9a6d0c1cd3485cf5887 ?
   I would assume that the close method would have to be as Congbo originally 
wrote
   ```java
           public void close() {
               if (complete.compareAndSet(false, true)) {
                   entryImpl.close();
               }
           }
   ```
   
   instead of the current version
   ```java
           public void close() {
               complete.set(true);
               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