Core: Fix flaky TestHadoopCommits.testConcurrentFastAppends#16770
Open
wombatu-kun wants to merge 1 commit into
Open
Core: Fix flaky TestHadoopCommits.testConcurrentFastAppends#16770wombatu-kun wants to merge 1 commit into
wombatu-kun wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
singhpk234
reviewed
Jun 11, 2026
| // lock-step contention below (matches Test{Jdbc,Hive}TableConcurrency). | ||
| COMMIT_NUM_RETRIES, | ||
| String.valueOf(threadsCount), | ||
| "20", |
Contributor
Author
There was a problem hiding this comment.
Because two sibling optimistic-commit concurrency tests TestJdbcTableConcurrency and TestHiveTableConcurrency both use 20 retries, and it looks like it's enough avoid flakiness this way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TestHadoopCommits.testConcurrentFastAppendsis flaky and fails intermittently withorg.awaitility.core.ConditionTimeoutExceptionat the barrier wait. It most recently surfaced on an unrelated PR (#16664) incore-tests (17)while the same job passed oncore-tests (21), the classic load-dependent flaky signature.Root cause
The test runs 5 threads that each commit 10 files, using an
AtomicIntegerbarrier to force all 5 threads to attemptnewFastAppend().commit()simultaneously in lock-step rounds, maximizing optimistic-concurrency contention on the Hadoop file-based commit. It setscommit.retry.num-retriestothreadsCount(5), only one above the default of 4. Under that forced contention, file-rename races are not fair, so a committer can lose more times than its retry budget allows, exhaust its retries, and throwCommitFailedException. The thread that throws never increments the barrier, so the surviving threads block onbarrier >= round * threadsCountuntil the awaitility timeout fires. Because the barrier is permanently stalled, no amount of additional wait time helps.This is a recurrence of #11047. The previous fix (#12714) only raised the awaitility timeout from 10s to 60s, which addressed the symptom rather than the cause, so the failure came back at the 60s boundary.
Fix
Raise
commit.retry.num-retriesfromthreadsCountto20, matching the two sibling optimistic-commit concurrency testsTestJdbcTableConcurrencyandTestHiveTableConcurrency, which both use20retries for 7 concurrent committers. With comfortable retry headroom no committer exhausts its budget under the forced contention, so the barrier always advances and the test no longer stalls. This does not weaken the test: it still verifies that all concurrent fast appends succeed and produce the expected number of snapshots.