This is an automated email from the ASF dual-hosted git repository.
zaynt4606 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new 7ebc6dfce9 [MINOR] Hoist shuffleKey out of CommitHandler commit-files
polling loop
7ebc6dfce9 is described below
commit 7ebc6dfce9adb3828b6986da6dfeedca3350c78d
Author: yew1eb <[email protected]>
AuthorDate: Fri Nov 20 10:39:17 2026 +0800
[MINOR] Hoist shuffleKey out of CommitHandler commit-files polling loop
### 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.
Closes #3935 from yew1eb/minor/commit-handler-shufflekey.
Authored-by: yew1eb <[email protected]>
Signed-off-by: zhengtao <[email protected]>
AI-Contributed/Feature: 0/2
AI-Contributed/UT: 0/0
---
.../main/scala/org/apache/celeborn/client/commit/CommitHandler.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/client/src/main/scala/org/apache/celeborn/client/commit/CommitHandler.scala
b/client/src/main/scala/org/apache/celeborn/client/commit/CommitHandler.scala
index 7660c375f1..b587c7a3ed 100644
---
a/client/src/main/scala/org/apache/celeborn/client/commit/CommitHandler.scala
+++
b/client/src/main/scala/org/apache/celeborn/client/commit/CommitHandler.scala
@@ -333,13 +333,13 @@ abstract class CommitHandler(
val timeout = clientRpcCommitFilesAskTimeout.duration.toMillis
var remainingTime = timeout * maxRetries
val delta = 50
+ val shuffleKey = Utils.makeShuffleKey(appUniqueId, shuffleId)
while (remainingTime >= 0 && !futures.isEmpty) {
val currentTime = System.currentTimeMillis()
val iter = futures.iterator()
while (iter.hasNext) {
val status = iter.next()
val worker = status.workerInfo
- val shuffleKey = Utils.makeShuffleKey(appUniqueId, shuffleId)
if (status.future.isCompleted) {
status.future.value.get match {
case scala.util.Success(res) =>