pnowojski commented on a change in pull request #11347: 
[FLINK-14971][checkpointing] Make all the non-IO operations in 
CheckpointCoordinator single-threaded
URL: https://github.com/apache/flink/pull/11347#discussion_r395000464
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java
 ##########
 @@ -304,35 +307,44 @@ public CheckpointException getFailureCause() {
                                "Pending checkpoint has not been fully 
acknowledged yet"));
                }
 
+               // now we stop the canceller before finalization
+               // it simplifies the concurrent conflict issue here
+               cancelCanceller();
+
                // make sure we fulfill the promise with an exception if 
something fails
                final CompletableFuture<CompletedCheckpoint> 
finalizedLocationFuture =
                        CompletableFuture.supplyAsync(() -> {
                        try {
-                               // write out the metadata
-                               final CheckpointMetadata savepoint = new 
CheckpointMetadata(checkpointId, operatorStates.values(), masterStates);
-                               final CompletedCheckpointStorageLocation 
finalizedLocation;
+                               synchronized (operationLock) {
+                                       if (isDiscarded()) {
+                                               throw new 
IllegalStateException("The checkpoint has been discarded");
+                                       }
 
 Review comment:
   nit: `checkState()`?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to