Skip to content

[MINOR] Hoist shuffleKey out of CommitHandler commit-files polling loop - #3935

Open
yew1eb wants to merge 1 commit into
apache:mainfrom
yew1eb:minor/commit-handler-shufflekey
Open

yew1eb wants to merge 1 commit into
apache:mainfrom
yew1eb:minor/commit-handler-shufflekey

Conversation

@yew1eb

@yew1eb yew1eb commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Move Utils.makeShuffleKey(appUniqueId, shuffleId) out of the inner while loop in CommitHandler.doParallelCommitFiles, so it is computed once before the polling loop instead of once per pending worker per 50 ms tick.

Why are the changes needed?

appUniqueId (constructor parameter) and shuffleId (method parameter) are both immutable, so shuffleKey is a loop invariant. The current code also evaluates it while the commit future is still pending and no log line is emitted. Hoisting it matches the pattern already used in CommitHandler.checkDataLost and LifecycleManager.destroySlotsWithRetry.

Pure refactor: no behavior change.

Does this PR resolve a correctness bug?

  • Yes

Does this PR introduce any user-facing change?

  • Yes

How was this patch tested?

  • build/sbt "celeborn-client/compile"
  • build/mvn spotless:check -pl client

The change is a mechanical move of one line. Existing unit tests do not exercise the commit-files polling loop.

shuffleKey depends only on immutable inputs (appUniqueId, shuffleId), so compute it once before the polling loop instead of once per pending worker per 50 ms tick. Pure refactor, no behavior change.

This branch has not been deployed

No deployments
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.

1 participant