You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by ni...@apache.org on 2026/03/05 06:33:12 UTC
(celeborn) branch branch-0.6 updated: [CELEBORN-2273] Fix cache mutation in TagsManager.getTaggedWorkers()
This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch branch-0.6
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/branch-0.6 by this push:
new 5d4bf85a3 [CELEBORN-2273] Fix cache mutation in TagsManager.getTaggedWorkers()
5d4bf85a3 is described below
commit 5d4bf85a3aa14f7cc63fe94e0cc325dbbbcc86c2
Author: ShlomiTubul <sh...@placer.ai>
AuthorDate: Thu Mar 5 14:32:49 2026 +0800
[CELEBORN-2273] Fix cache mutation in TagsManager.getTaggedWorkers()
What changes were proposed in this pull request?
getTaggedWorkers() obtains a direct reference to the cached Set from getWorkersWithTag()and then calls retainAll() on it to intersect with other tags and available workers. Since retainAll() mutates the Set in-place, this permanently corrupts the cached entry. When multiple applications with different tag combinations share the same master, one app's intersection shrinks the cached Set, causing subsequent lookups by other apps to find fewer or zero workers. Once corrupted to an empty [...]
Why are the changes needed?
Does this PR resolve a correctness bug?
Yes
Does this PR introduce any user-facing change?
No
How was this patch tested?
custom image in my dev env + local test
Closes #3615 from shlomitubul/main.
Authored-by: ShlomiTubul <sh...@placer.ai>
Signed-off-by: SteNicholas <pr...@163.com>
(cherry picked from commit 391ef4bfc42b4c121d6a029d60689af15ab16b5b)
Signed-off-by: SteNicholas <pr...@163.com>
---
.../org/apache/celeborn/service/deploy/master/tags/TagsManager.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/master/src/main/scala/org/apache/celeborn/service/deploy/master/tags/TagsManager.scala b/master/src/main/scala/org/apache/celeborn/service/deploy/master/tags/TagsManager.scala
index f8491edb0..74aa69092 100644
--- a/master/src/main/scala/org/apache/celeborn/service/deploy/master/tags/TagsManager.scala
+++ b/master/src/main/scala/org/apache/celeborn/service/deploy/master/tags/TagsManager.scala
@@ -79,7 +79,7 @@ class TagsManager(configService: Option[ConfigService]) extends Logging {
case Some(w) =>
w.retainAll(taggedWorkers)
case _ =>
- workersForTags = Some(taggedWorkers)
+ workersForTags = Some(new util.HashSet[String](taggedWorkers))
}
}