Skip to content

Commit

Permalink
[FLINK-18290][checkpointing] Don't System.exit on CheckpointCoordinat…
Browse files Browse the repository at this point in the history
…or failure if it is shut down
  • Loading branch information
rkhachatryan authored and pnowojski committed Jun 17, 2020
1 parent dfe0521 commit f85dfbb
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -582,7 +583,17 @@ private void startTriggeringCheckpoint(CheckpointTriggerRequest request) {

return null;
},
timer));
timer)
.exceptionally(error -> {
if (!isShutdown()) {
throw new CompletionException(error);
} else if (error instanceof RejectedExecutionException) {
LOG.debug("Execution rejected during shutdown");
} else {
LOG.warn("Error encountered during shutdown", error);
}
return null;
}));
} catch (Throwable throwable) {
onTriggerFailure(request, throwable);
}
Expand Down

0 comments on commit f85dfbb

Please sign in to comment.