zentol commented on a change in pull request #17572:
URL: https://github.com/apache/flink/pull/17572#discussion_r738199426
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointsCleaner.java
##########
@@ -89,9 +95,34 @@ private void cleanup(
checkpoint.getCheckpointID(),
e);
} finally {
- numberOfCheckpointsToClean.decrementAndGet();
+ decrementNumberOfCheckpointsToClean();
postCleanupAction.run();
}
});
}
+
+ private synchronized void decrementNumberOfCheckpointsToClean() {
+ numberOfCheckpointsToClean--;
+ maybeCompleteCloseUnsafe();
+ }
+
+ private void maybeCompleteCloseUnsafe() {
+ if (numberOfCheckpointsToClean == 0 && cleanUpFuture != null) {
+ cleanUpFuture.complete(null);
+ }
+ }
+
+ private synchronized void incrementNumberOfCheckpointsToClean() {
Review comment:
nit: put this above `decrement*`
--
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]