pnowojski 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_r293258163
##########
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:
Yes, you are right. I forgot that the code is waiting on the latch there.
----------------------------------------------------------------
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