XComp commented on code in PR #19567:
URL: https://github.com/apache/flink/pull/19567#discussion_r858547701
##########
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java:
##########
@@ -652,20 +653,47 @@ private CompletableFuture<CleanupJobState>
handleJobManagerRunnerResult(
&& executionType == ExecutionType.RECOVERY) {
return CompletableFuture.completedFuture(
jobManagerRunnerFailed(
-
jobManagerRunnerResult.getExecutionGraphInfo().getJobId(),
+ jobManagerRunnerResult,
jobManagerRunnerResult.getInitializationFailure()));
}
return
jobReachedTerminalState(jobManagerRunnerResult.getExecutionGraphInfo());
}
- enum CleanupJobState {
- LOCAL,
- GLOBAL
+ private static class CleanupJobState {
+
+ private final JobStatus jobStatus;
+ private final boolean globalCleanup;
+
+ public static CleanupJobState localCleanup(JobStatus jobStatus) {
+ return new CleanupJobState(jobStatus, false);
+ }
+
+ public static CleanupJobState globalCleanup(JobStatus jobStatus) {
+ return new CleanupJobState(jobStatus, true);
+ }
+
+ private CleanupJobState(JobStatus jobStatus, boolean globalCleanup) {
+ this.jobStatus = jobStatus;
+ this.globalCleanup = globalCleanup;
+ }
+
+ public boolean isGlobalCleanup() {
+ return globalCleanup;
+ }
+
+ public JobStatus getJobStatus() {
+ return jobStatus;
+ }
}
- private CleanupJobState jobManagerRunnerFailed(JobID jobId, Throwable
throwable) {
- jobMasterFailed(jobId, throwable);
- return CleanupJobState.LOCAL;
+ private CleanupJobState jobManagerRunnerFailed(
+ JobManagerRunnerResult jobManagerRunnerResult, Throwable
throwable) {
Review Comment:
yikes, you have a point. But while looking into it I noticed that I did
something stupid here: I used the `jobManagerRunnerResult` for
`jobManagerRunnerFailed` in the case where `jobManagerRunnerResult` is actually
`null`. I fixed this now. But I'm gonna double-check why this never came up in
any test. It should have resulted in a `NullPointException` but it seems that
all tests pass which means that we're not covering this codepath, yet.
--
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]