You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kfaraz (via GitHub)" <gi...@apache.org> on 2023/05/12 13:21:32 UTC

[GitHub] [druid] kfaraz commented on a diff in pull request #14270: Fix condition for timeout in worker task launcher

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


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:
##########
@@ -762,9 +762,10 @@ public boolean didFail()
      */
     public boolean didRunTimeOut(final long maxTaskStartDelayMillis)
     {
+      long currentTimeMillis = System.currentTimeMillis();
       return (status == null || status.getStatusCode() == TaskState.RUNNING)
              && unknownLocation()
-             && System.currentTimeMillis() - recentFullyStartedWorkerTimeInMs.get() > maxTaskStartDelayMillis;
+             && (currentTimeMillis - recentFullyStartedWorkerTimeInMs.get() > maxTaskStartDelayMillis && currentTimeMillis - startTimeMs > maxTaskStartDelayMillis);

Review Comment:
   For readability:
   ```suggestion
                && currentTimeMillis - recentFullyStartedWorkerTimeInMs.get() > maxTaskStartDelayMillis
                && currentTimeMillis - startTimeMs > maxTaskStartDelayMillis;
   ```



-- 
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@druid.apache.org

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


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