You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/08/24 17:23:43 UTC

[GitHub] [helix] lei-xia commented on a change in pull request #1227: Implement thread leakage check, fixing major thread leakage test and some flaky test

lei-xia commented on a change in pull request #1227:
URL: https://github.com/apache/helix/pull/1227#discussion_r475776419



##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -969,17 +969,29 @@ public TaskState pollForJobState(String workflowName, String jobName, long timeo
     Set<TaskState> allowedStates = new HashSet<>(Arrays.asList(states));
     // Wait for state
     long st = System.currentTimeMillis();
+    long ct = 0;
     do {
       Thread.sleep(timeToSleep);
       ctx = getWorkflowContext(workflowName);
+      ct =  System.currentTimeMillis();
     } while ((ctx == null || ctx.getJobState(jobName) == null
         || !allowedStates.contains(ctx.getJobState(jobName)))
-        && System.currentTimeMillis() < st + timeout);
+        && ct < st + timeout);
 
     if (ctx == null || !allowedStates.contains(ctx.getJobState(jobName))) {

Review comment:
       What is the purpose of this change?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org