1u0 commented on a change in pull request #8602: [FLINK-12313] Add workaround to avoid race condition in SynchronousCheckpointITCase test URL: https://github.com/apache/flink/pull/8602#discussion_r293019590
########## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/SynchronousCheckpointITCase.java ########## @@ -125,16 +126,24 @@ public void taskCachedThreadPoolAllowsForSynchronousCheckpoints() throws Excepti assertEquals(ExecutionState.RUNNING, task.getExecutionState()); assertEquals(CheckpointingState.NONE, synchronousCheckpointPhase.getState()); + // Hack: we are triggering a checkpoint with advanceToEndOfEventTime = true, to be sure that + // triggerCheckpointBarrier has reached the sync checkpoint latch (by verifying in + // SynchronousCheckpointTestingTask.advanceToEndOfEventTime) and only then proceeding to + // notifyCheckpointComplete. + // Without such synchronization, the notifyCheckpointComplete execution may be executed first and leave this + // test in a deadlock. task.triggerCheckpointBarrier( 42, 156865867234L, new CheckpointOptions(CheckpointType.SYNC_SAVEPOINT, CheckpointStorageLocationReference.getDefault()), - false); + true); Review comment: Do you mean to get a future that would wait for result of `invokable.triggerCheckpoint()` call? In that case, I think what you are proposing would deadlock the test. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services