You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/05/17 21:22:18 UTC

[GitHub] [incubator-pinot] akshayrai commented on a change in pull request #4217: [TE] distribute detection and notification tasks

akshayrai commented on a change in pull request #4217: [TE] distribute detection and notification tasks
URL: https://github.com/apache/incubator-pinot/pull/4217#discussion_r285292766
 
 

 ##########
 File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/yaml/CompositePipelineConfigTranslator.java
 ##########
 @@ -379,16 +380,24 @@ private void fillInDetectorWrapperProperties(Map<String, Object> properties, Map
     return properties;
   }
 
+  //  Default schedule:
+  //  minute granularity: every 15 minutes, starts at 0 minute
+  //  hourly: every hour, starts at 0 minute
+  //  daily: every day, starts at 2 pm UTC
+  //  others: every day, start at 12 am UTC
   private String buildCron() {
+    // starts at random second to reduce task spike
+    Random random = new Random();
+    String second = Integer.toString(random.nextInt(59));
     switch (this.datasetConfig.bucketTimeGranularity().getUnit()) {
       case MINUTES:
-        return "0 0/15 * * * ? *";
+        return second + " 0/15 * * * ? *";
 
 Review comment:
   Can we avoid adding buffer time to the cron and instead include the buffer when the task is picked up and executed. I feel it will be cleaner and easier to debug issues that way.
   
   Moreover, we resort to buildCron method only if the cron is not defined in the yaml config. In other cases, the cron will remain plain without the buffer.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org