homatthew commented on code in PR #3556:
URL: https://github.com/apache/gobblin/pull/3556#discussion_r966489907


##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/HelixUtils.java:
##########
@@ -278,9 +278,12 @@ static void waitJobCompletion(HelixManager helixManager, 
String workFlowName, St
           case STOPPING:
             log.info("Waiting for job {} to complete... State - {}", jobName, 
jobState);
             Thread.sleep(TimeUnit.SECONDS.toMillis(1L));
+            if (stoppingStateEndTime == 0) {
+              stoppingStateEndTime = currentTimeMillis + 
stoppingStateTimeoutInSeconds * 1000;
+            }
             // Workaround for a Helix bug where a job may be stuck in the 
STOPPING state due to an unresponsive task.
-            if (System.currentTimeMillis() > stoppingStateEndTime) {
-              log.info("Deleting workflow {}", workFlowName);
+            if (stoppingStateEndTime != 0 && System.currentTimeMillis() > 
stoppingStateEndTime) {

Review Comment:
   Nit: won't happen b.c. of line 281



##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/HelixUtils.java:
##########
@@ -260,7 +260,7 @@ static void waitJobCompletion(HelixManager helixManager, 
String workFlowName, St
       endTime = currentTimeMillis + timeoutInSeconds.get() * 1000;

Review Comment:
   `currentTimeMillis` should be changed to start time because it actually 
denote the start of the job and not the curren time. If we need current time 
just use system time 



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

Reply via email to