vernedeng commented on code in PR #9024:
URL: https://github.com/apache/inlong/pull/9024#discussion_r1349610584


##########
inlong-manager/manager-plugins/base/src/main/java/org/apache/inlong/manager/plugin/flink/FlinkOperation.java:
##########
@@ -351,20 +350,21 @@ public void pollJobStatus(FlinkInfo flinkInfo) throws 
Exception {
                 }
 
                 JobStatus jobStatus = jobDetailsInfo.getJobStatus();
-                if (jobStatus.isTerminalState()) {
+                if (jobStatus.isTerminalState() && expectStatus != 
JobStatus.CANCELED) {
                     log.error("job was terminated for {}, exception: {}", 
jobId, flinkInfo.getExceptionMsg());
                     throw new Exception("job was terminated for " + jobId);
                 }
 
-                if (jobStatus == RUNNING) {
-                    log.info("job status is Running for {}", jobId);
+                if (jobStatus == expectStatus) {
+                    log.info("job status is {} for {}", jobStatus, jobId);
                     break;
                 }
-                log.info("job was not Running for {}", jobId);
-                TimeUnit.SECONDS.sleep(5);
+                log.info("job status is {} for {}", jobStatus, jobId);
             } catch (Exception e) {
                 log.error("poll job status error for {}, exception: ", 
flinkInfo, e);
             }
+            TimeUnit.SECONDS.sleep(5);

Review Comment:
   why sleep 5 ms



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