kfaraz commented on code in PR #18020:
URL: https://github.com/apache/druid/pull/18020#discussion_r2097137549


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java:
##########
@@ -531,6 +531,8 @@ public boolean add(final Task task)
       // insert the task into our queue. So don't catch it.
       final DateTime insertTime = DateTimes.nowUtc();
       taskStorage.insert(task, TaskStatus.running(task.getId()));
+      // Note: the TaskEntry created for this task doesn't actually use the 
`insertTime` timestamp, it uses a new
+      // timestamp created in the ctor. This prevents races from occurring 
while syncFromStorage() is happening.

Review Comment:
   Thinking about this some more.
   
   I wonder if we should actually use the timestamp `insertTime` that is passed 
here to construct the `TaskEntry`.
   It would make the behaviour of the `TaskEntry.lastUpdatedTime` more 
consistent.
   
   If we do make that change though, we would need to do `addTaskInternal(task, 
DateTimes.nowUtc())` rather than use an `insertTime` that is from before 
`taskStorage.insert`.
   
   @jtuglu-netflix , what do you think?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to