WencongLiu commented on code in PR #22341: URL: https://github.com/apache/flink/pull/22341#discussion_r1283944785
########## flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMasterServiceLeadershipRunner.java: ########## @@ -277,18 +277,11 @@ private void startJobMasterServiceProcessAsync(UUID leaderSessionId) { @GuardedBy("lock") private void verifyJobSchedulingStatusAndCreateJobMasterServiceProcess(UUID leaderSessionId) - throws FlinkException { - try { - if (jobResultStore.hasJobResultEntry(getJobID())) { - jobAlreadyDone(leaderSessionId); - } else { - createNewJobMasterServiceProcess(leaderSessionId); - } - } catch (IOException e) { - throw new FlinkException( - String.format( - "Could not retrieve the job scheduling status for job %s.", getJobID()), - e); + throws FlinkException, ExecutionException, InterruptedException { + if (jobResultStore.hasJobResultEntryAsync(getJobID()).get()) { Review Comment: Yes, I agree that make both `startJobMasterServiceProcessAsync` and `verifyJobSchedulingStatusAndCreateJobMasterServiceProcess` leverage the async nature is important. Currently dealing with the sync and async future logic in these methods will be complex and make the code hard to understand, so refactoring this needs to be well designed and may be completed in another pr, WDYT? -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org