labuladong commented on code in PR #16812:
URL: https://github.com/apache/pulsar/pull/16812#discussion_r1014918877
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -89,7 +89,7 @@ public class PersistentDispatcherMultipleConsumers extends
AbstractDispatcherMul
protected volatile PositionImpl minReplayedPosition = null;
protected boolean shouldRewindBeforeReadingOrReplaying = false;
protected final String name;
-
+ protected boolean sendInProgress;
Review Comment:
`synchronized` handles lock and `volatile` handles visibility, see here:
https://stackoverflow.com/questions/3519664/difference-between-volatile-and-synchronized-in-java
I still think this flag should be `volatile`, to ensure all threads can
observe the change of this flag immediately.
--
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]