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 2021/04/12 01:40:59 UTC

[GitHub] [pulsar] baomingyu commented on a change in pull request #10168: fix 10169 Delayed messages may be executed several milliseconds in advance

baomingyu commented on a change in pull request #10168:
URL: https://github.com/apache/pulsar/pull/10168#discussion_r611281636



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
##########
@@ -238,6 +238,9 @@
             + " affecting the accuracy of the delivery time compared to the scheduled time. Default is 1 second.")
     private long delayedDeliveryTickTimeMillis = 1000;
 
+    @FieldContext(category = CATEGORY_SERVER, doc = "HashedWheelTimer duration tick time for when retrying on delayed delivery")
+    private long delayedDeliveryTickDurationMillis = 1000;

Review comment:
       Now delayedDeliveryTickTimeMillis is used both delay message and  wheeltimer , so i can not change config only one, 
   For decrease delayedDeliveryTickTimeMillis to 5ms or lower, will affect wheeltimer .
   Sometimes, delay of several milliseconds is acceptable but not milliseconds ahead,so this configuration ‘delayedDeliveryTickTimeMillis’  can't fully meet the requirements.
    I add this delayedDeliveryTickDurationMillis config to separate the two configurations,after adding delayedDeliveryTickDurationMillis  ,i can config delayedDeliveryTickTimeMillis with 0, and delay message will not be consumer any millisecond level ahead.
   Befor changing:
   > Befor changing:   
   public void initialize(ServiceConfiguration config) {
                   this.timer = new HashedWheelTimer(new DefaultThreadFactory("pulsar-delayed-delivery"),
                   config.getDelayedDeliveryTickTimeMillis(), TimeUnit.MILLISECONDS);
                  this.tickTimeMillis = config.getDelayedDeliveryTickTimeMillis();
       }
   
   > after changing:
    public void initialize(ServiceConfiguration config) {
           this.timer = new HashedWheelTimer(new DefaultThreadFactory("pulsar-delayed-delivery"),
                   config.getDelayedDeliveryTickDurationMillis(), TimeUnit.MILLISECONDS);
           this.tickTimeMillis = config.getDelayedDeliveryTickTimeMillis();
       }




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

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