Skip to content

Conversation

@zuston
Copy link
Member

@zuston zuston commented Jan 13, 2026

What changes were proposed in this pull request?

Fix race condition on deferred compressed block initialization

Why are the changes needed?

fix #2711

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing unit tests

@zuston zuston requested a review from xianjingfeng January 13, 2026 09:45
@github-actions
Copy link

github-actions bot commented Jan 13, 2026

Test Results

 3 175 files  ±0   3 175 suites  ±0   6h 53m 44s ⏱️ +44s
 1 238 tests ±0   1 237 ✅ ±0   1 💤 ±0  0 ❌ ±0 
15 689 runs  ±0  15 674 ✅ ±0  15 💤 ±0  0 ❌ ±0 

Results for commit 3d120fb. ± Comparison against base commit f43f66f.

♻️ This comment has been updated with latest results.

private final Function<DeferredCompressedBlock, DeferredCompressedBlock> rebuildFunction;
private int estimatedCompressedSize;
private boolean isInitialized = false;
private AtomicBoolean isInitialized = new AtomicBoolean(false);
Copy link
Member

Choose a reason for hiding this comment

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

Is this change still needed after using synchronized?

Copy link
Member Author

Choose a reason for hiding this comment

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

I use the double-lock to ensure the rebuilding happen only once, maybe this is not necessary to make this var sync.

@xianjingfeng
Copy link
Member

Could you explain the reason for this issue? @zuston

@zuston
Copy link
Member Author

zuston commented Jan 14, 2026

Could you explain the reason for this issue? @zuston

This bug only happens when the overlapping compression is enabled, this will be modified by the multi threads at the same time

@xianjingfeng
Copy link
Member

Could you explain the reason for this issue? @zuston

This bug only happens when the overlapping compression is enabled, this will be modified by the multi threads at the same time

What I don't understand is why block.data would be null in a multi-threaded environment. Even with repeated calls to the rebuildFunction function, block.data is only overwritten, not set to null.

@zuston
Copy link
Member Author

zuston commented Jan 14, 2026

Could you explain the reason for this issue? @zuston

This bug only happens when the overlapping compression is enabled, this will be modified by the multi threads at the same time

What I don't understand is why block.data would be null in a multi-threaded environment. Even with repeated calls to the rebuildFunction function, block.data is only overwritten, not set to null.

Got your thought, I haven't found the root cause.

@zuston
Copy link
Member Author

zuston commented Jan 15, 2026

thanks. @xianjingfeng @jerqi let me merge this

@zuston zuston merged commit 3525bab into apache:master Jan 15, 2026
41 checks passed
@zuston zuston deleted the fixnpe branch January 15, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flaky Test] org.apache.uniffle.test.GetShuffleReportForMultiPartTest

3 participants