lhotari commented on code in PR #25681:
URL: https://github.com/apache/pulsar/pull/25681#discussion_r3209338528
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/InMemoryDelayedDeliveryTracker.java:
##########
@@ -122,21 +122,29 @@ private static long trimLowerBit(long timestamp, int
bits) {
}
@Override
- public boolean addMessage(long ledgerId, long entryId, long deliverAt) {
+ public synchronized boolean addMessage(long ledgerId, long entryId, long
deliverAt) {
Review Comment:
The test is expected to fail since the existing design in assumes that the
dispatcher synchronizes the access. One way to address this is expand the scope
of this PR to handle the refactoring which takes care of synchronization in
`AbstractDelayedDeliveryTracker` so that the subclasses like
`InMemoryDeliveryTracker` wouldn't need to worry about the synchronization
concerns. (for example making addMessage final in
`AbstractDelayedDeliveryTracker` and delegating to an abstract method
`internalAddMessage` which is executed inside a `synchronized(dispatcher) {
.... }` block. Another approach is to remove this test from this PR and add it
to a separate PR which refactors `AbstractDelayedDeliveryTracker` as described.
--
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]