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 2022/07/13 04:10:53 UTC

[GitHub] [pulsar] codelipenghui commented on a diff in pull request #16546: [fix][broker]check the cursor status when handling flowPermits

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

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