codelipenghui commented on code in PR #16546:
URL: https://github.com/apache/pulsar/pull/16546#discussion_r919629700


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java:
##########
@@ -278,6 +279,11 @@ private synchronized void internalConsumerFlow(Consumer 
consumer) {
                 log.debug("[{}-{}] Ignoring flow control message since 
consumer is waiting for cursor to be rewinded",
                         name, consumer);
             }
+        } else if (((ManagedCursorImpl) cursor).resetCursorInProgress()) {
+            if (log.isDebugEnabled()) {
+                log.debug("[{}-{}] Ignoring flow control message since cursor 
reset in progress - cursor {}",
+                        name, consumer, cursor.getName());
+            }

Review Comment:
   This can avoid the new flow permit requests but can't prevent an in-process 
entry reading operation? The client-side also has an opportunity to receive 
messages after the seek position.



##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -3283,4 +3283,13 @@ public void setState(State state) {
     public ManagedLedgerConfig getConfig() {
         return config;
     }
+
+    /**
+     * check cursor reset status.
+     *
+     * @return true if the cursor reset in progress
+     */
+    public boolean resetCursorInProgress() {

Review Comment:
   ```suggestion
       public boolean isResetCursorInProgress() {
   ```



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