You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/09/22 05:25:12 UTC

[GitHub] [pulsar] zymap commented on a change in pull request #12123: Fix the potential race condition in the BlobStore readhandler

zymap commented on a change in pull request #12123:
URL: https://github.com/apache/pulsar/pull/12123#discussion_r713600965



##########
File path: tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreBackedReadHandleImpl.java
##########
@@ -105,6 +118,11 @@ public LedgerMetadata getLedgerMetadata() {
                 long nextExpectedId = firstEntry;
                 try {
                     while (entriesToRead > 0) {
+                        State state = STATE_UPDATER.get(this);
+                        if (state == State.Closed) {
+                            log.warn("Reading a closed read handler. Ledger ID: {}, Read range: {}-{}", ledgerId, firstEntry, lastEntry);
+                            throw new BKException.BKUnexpectedConditionException();

Review comment:
       The `promise` is completed in the `catch` section.




-- 
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: commits-unsubscribe@pulsar.apache.org

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