Skip to content

Commit

Permalink
[Bugfix][Zeta] Fix the checkpoint blocking with long time (apache#5694)
Browse files Browse the repository at this point in the history
  • Loading branch information
happyboy1024 committed Oct 24, 2023
1 parent 7262bd9 commit 1f16aeb
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ public void collect() throws Exception {
Thread.sleep(100);
} else {
collector.resetEmptyThisPollNext();
/**
* The current thread obtain a checkpoint lock in the method {@link
* SourceReader#pollNext(Collector)}. When trigger the checkpoint or savepoint,
* other threads try to obtain the lock in the method {@link
* SourceFlowLifeCycle#triggerBarrier(Barrier)}. When high CPU load, checkpoint
* process may be blocked as long time. So we need sleep to free the CPU.
*/
Thread.sleep(0L);
}

if (collector.captureSchemaChangeBeforeCheckpointSignal()) {
Expand Down

0 comments on commit 1f16aeb

Please sign in to comment.