eemario commented on code in PR #27324:
URL: https://github.com/apache/flink/pull/27324#discussion_r2630312619


##########
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java:
##########
@@ -595,7 +642,17 @@ private CompletableFuture<Acknowledge> 
internalSubmitJob(ExecutionPlan execution
             applyParallelismOverrides((JobGraph) executionPlan);
         }
 
-        log.info("Submitting job '{}' ({}).", executionPlan.getName(), 
executionPlan.getJobID());
+        final JobID jobId = executionPlan.getJobID();
+        final String jobName = executionPlan.getName();
+        final ApplicationID applicationId = executionPlan.getApplicationId();
+        log.info("Submitting job '{}' ({}).", jobName, jobId);
+
+        if (applications.containsKey(applicationId)) {
+            applications.get(applicationId).addJob(jobId);
+        } else {
+            log.warn(
+                    "Application ({}) for job '{}' ({}) not found.", 
applicationId, jobName, jobId);

Review Comment:
   For now, this can occur in two cases: 
   1. CLI/REST submissions of jobs without an application; 
   2. Tests for `submitJob` that submit jobs without an application.
   The first case should no longer exist after SingleJobApplication is 
implemented. Added comments to explain.



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