alexandrebrg commented on code in PR #26174:
URL: https://github.com/apache/pulsar/pull/26174#discussion_r3569220825


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java:
##########
@@ -74,6 +74,11 @@ public class PersistentDispatcherSingleActiveConsumer 
extends AbstractDispatcher
     private Optional<DispatchRateLimiter> dispatchRateLimiter = 
Optional.empty();
 
     protected volatile boolean havePendingRead = false;
+    // Monotonic identity of the read that havePendingRead currently refers 
to. Bumped under this monitor
+    // whenever readMoreEntries issues a read; a completion mutates dispatcher 
state only when its captured
+    // generation still matches, so a completion whose read was disowned by a 
redeliver-driven rewind + re-arm
+    // is ignored instead of clearing havePendingRead for the newer 
outstanding read. Guarded by "this".
+    private long readGeneration = 0L;

Review Comment:
   Indeed, fixed



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