azagrebin commented on a change in pull request #6587: [FLINK-10011] Release
JobGraph from SubmittedJobGraphStore
URL: https://github.com/apache/flink/pull/6587#discussion_r212321052
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/ZooKeeperCompletedCheckpointStore.java
##########
@@ -237,7 +239,18 @@ public void addCheckpoint(final CompletedCheckpoint
checkpoint) throws Exception
// Everything worked, let's remove a previous checkpoint if
necessary.
while (completedCheckpoints.size() >
maxNumberOfCheckpointsToRetain) {
try {
-
removeSubsumed(completedCheckpoints.removeFirst());
+ final CompletedCheckpoint completedCheckpoint =
completedCheckpoints.removeFirst();
Review comment:
I would try to move the whole try/catch into one method to deduplicate code
with `shutdown()`, e.g.:
```
void tryRemove(Runnable doRemove) {
try {
// ..
doRemove.run(); // completedCheckpoint.discardOnSubsume(); or
OnShutdown
// ..
} catch {
// ...
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services