XComp commented on a change in pull request #18627:
URL: https://github.com/apache/flink/pull/18627#discussion_r800560506



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java
##########
@@ -515,18 +548,30 @@ private boolean isPartialResourceConfigured(JobGraph 
jobGraph) {
 
     private void persistAndRunJob(JobGraph jobGraph) throws Exception {
         jobGraphWriter.putJobGraph(jobGraph);
-        runJob(jobGraph, ExecutionType.SUBMISSION);
+        initializeAndStartJobManagerRunner(jobGraph, ExecutionType.SUBMISSION);
     }
 
-    private void runJob(JobGraph jobGraph, ExecutionType executionType) throws 
Exception {
+    private void initializeAndStartJobManagerRunner(JobGraph jobGraph, 
ExecutionType executionType)
+            throws Exception {
         
Preconditions.checkState(!jobManagerRunnerRegistry.isRegistered(jobGraph.getJobID()));
-        long initializationTimestamp = System.currentTimeMillis();
-        JobManagerRunner jobManagerRunner =
-                createJobManagerRunner(jobGraph, initializationTimestamp);
+        final JobManagerRunner jobManagerRunner = 
initializeJobManagerRunner(jobGraph);
+        runJob(jobManagerRunner, executionType);
+    }
+
+    private void initializeAndStartCheckpointJobDataCleanupRunner(JobResult 
jobResult)

Review comment:
       I'm not a big fan of moving business logic (recovery of JobGraphs and 
cleaning up recovered dirty jobs) into the constructor. The constructor should 
be used for initializing the component. That's why I left the initialization in 
the `onStart` method




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