[ https://issues.apache.org/jira/browse/GOBBLIN-1068?focusedWorklogId=416749&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-416749 ]
ASF GitHub Bot logged work on GOBBLIN-1068: ------------------------------------------- Author: ASF GitHub Bot Created on: 06/Apr/20 16:45 Start Date: 06/Apr/20 16:45 Worklog Time Spent: 10m Work Description: sv2000 commented on pull request #2907: [GOBBLIN-1068]Clean up cyclic logic in task cancellation URL: https://github.com/apache/incubator-gobblin/pull/2907#discussion_r404207115 ########## File path: gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SleepingTask.java ########## @@ -64,19 +70,27 @@ public void run() { throw new IOException("File creation error: " + taskStateFile.getName()); } long endTime = System.currentTimeMillis() + sleepTime * 1000; - while (System.currentTimeMillis() <= endTime) { - Thread.sleep(1000L); - log.warn("Sleeping for {} seconds", sleepTime); - } + + AssertWithBackoff.create().maxSleepMs(1000).timeoutMs(Integer.MAX_VALUE).backoffFactor(1). + assertTrue(new Predicate<Void>() { + @Override + public boolean apply(@Nullable Void input) { + return System.currentTimeMillis() > endTime; + } + }, "Waiting for the job to start..."); + log.info("Hello World!"); super.run(); } catch (InterruptedException e) { - log.error("Sleep interrupted."); + log.info("Sleep interrupted."); Review comment: Nit: Prefer to keep the log level here to error, given that this is an exception we are propagating. ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 416749) > Clean cyclic logic in task cancellation in Gobblin Task > ------------------------------------------------------- > > Key: GOBBLIN-1068 > URL: https://issues.apache.org/jira/browse/GOBBLIN-1068 > Project: Apache Gobblin > Issue Type: Bug > Reporter: Lei Sun > Priority: Major > Time Spent: 1.5h > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)