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/08/15 05:51:00 UTC

[GitHub] [pulsar] GuoHaoZai commented on a diff in pull request #17092: [improve][broker]: DelayedDeliveryTracker init and addMessage

GuoHaoZai commented on code in PR #17092:
URL: https://github.com/apache/pulsar/pull/17092#discussion_r945440111


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/InMemoryDelayedDeliveryTracker.java:
##########
@@ -111,8 +111,10 @@ public boolean addMessage(long ledgerId, long entryId, long deliverAt) {
         }
 
 
-        priorityQueue.add(deliverAt, ledgerId, entryId);
-        updateTimer();
+        synchronized (this) {

Review Comment:
   what do you think add `synchronized` to InMemoryDelayedDeliveryTracker#addMessage.
    
   and i have a question: InMemoryDelayedDeliveryTracker#getScheduledMessages is also need a `synchronized` ?



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