Skip to content

Commit

Permalink
[fix][broker] Revert "[fix][broker] Cancel possible pending replay re…
Browse files Browse the repository at this point in the history
…ad in cancelPendingRead (#23384)" (#23855)
  • Loading branch information
lhotari authored Jan 17, 2025
1 parent 8f04945 commit ea56ada
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public SubType getType() {

public abstract boolean isConsumerAvailable(Consumer consumer);

/**
* Cancel a possible pending read that is a Managed Cursor waiting to be notified for more entries.
* This won't cancel any other pending reads that are currently in progress.
*/
protected void cancelPendingRead() {}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,8 @@ public synchronized CompletableFuture<Void> disconnectAllConsumers(

@Override
protected void cancelPendingRead() {
if ((havePendingRead || havePendingReplayRead) && cursor.cancelPendingReadRequest()) {
if (havePendingRead && cursor.cancelPendingReadRequest()) {
havePendingRead = false;
havePendingReplayRead = false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,8 @@ public synchronized CompletableFuture<Void> disconnectAllConsumers(

@Override
protected void cancelPendingRead() {
if ((havePendingRead || havePendingReplayRead) && cursor.cancelPendingReadRequest()) {
if (havePendingRead && cursor.cancelPendingReadRequest()) {
havePendingRead = false;
havePendingReplayRead = false;
}
}

Expand Down

0 comments on commit ea56ada

Please sign in to comment.