lhotari commented on PR #20032:
URL: https://github.com/apache/pulsar/pull/20032#issuecomment-2459546477

   > DEFAULT_CONSUMER_EPOCH as seem as CONSUMER_EPOCH.get(this), we need to 
solves the reconnect and redeliver race condition. Using DEFAULT_CONSUMER_EPOCH 
seems to make the problem more complicated
   
   Ok, I can now see that the synchronized block is there to prevent the race 
in increasing the epoch. I hope that we'd have a proper test for the race by 
injecting a delay to have a real race.
   
   There's also another issue with the permits. `increaseAvailablePermits` 
should only be called if writing of the redeliverUnacknowledgedMessages command 
succeeds. That should be done in the promise callback of writeAndFlush to 
ensure that permits aren't increased in the case where the connection is not 
available.


-- 
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-unsubscr...@pulsar.apache.org

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

Reply via email to