This is an automated email from the ASF dual-hosted git repository.

nicholasjiang 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 391ef4bfc [CELEBORN-2273] Fix cache mutation in 
TagsManager.getTaggedWorkers()
391ef4bfc is described below

commit 391ef4bfc42b4c121d6a029d60689af15ab16b5b
Author: ShlomiTubul <[email protected]>
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 <[email protected]>
    Signed-off-by: SteNicholas <[email protected]>
---
 .../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))
       }
     }
 

Reply via email to