Skip to content

Conversation

@Hisoka-X
Copy link
Member

Purpose of this pull request

Optimize unstable CheckpointErrorRestoreEndTest cases. Please refer https://github.com/chestnut-c/seatunnel/actions/runs/16491224128/job/46633557547.
image

Does this PR introduce any user-facing change?

no

How was this patch tested?

exist test.

Check list

@github-actions github-actions bot added the Zeta label Jul 24, 2025
@nielifeng nielifeng requested a review from Copilot July 25, 2025 01:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the CheckpointErrorRestoreEndTest cases by replacing a non-thread-safe Integer field with an AtomicInteger to prevent race conditions in concurrent environments.

  • Replace Integer pipelineRestoreNum with AtomicInteger for thread-safe counting
  • Update initialization, increment, and getter operations to use atomic operations
  • Maintain existing synchronization around the restore logic

synchronized (restoreLock) {
try {
pipelineRestoreNum++;
pipelineRestoreNum.getAndIncrement();
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The increment operation is already synchronized by the restoreLock, making the atomic operation redundant. Consider using pipelineRestoreNum.incrementAndGet() or just pipelineRestoreNum++ since the synchronization block already provides thread safety.

Suggested change
pipelineRestoreNum.getAndIncrement();
pipelineRestoreNum++;

Copilot uses AI. Check for mistakes.
@corgy-w corgy-w merged commit 0633f6f into apache:dev Jul 28, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants