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 43b6e657eb [CELEBORN-2455] Remove redundant synchronized in 
Dispatcher.postMessage
43b6e657eb is described below

commit 43b6e657ebcd5e47ebad6f3e285c277b32a730ce
Author: yew1eb <[email protected]>
AuthorDate: Sat Oct 10 14:16:35 2026 +0800

    [CELEBORN-2455] Remove redundant synchronized in Dispatcher.postMessage
    
    ### What changes were proposed in this pull request?
    
    Remove the redundant `synchronized` block around the first 
`endpoints.get(endpointName)` read in `Dispatcher.postMessage`.
    
    ### Why are the changes needed?
    
     `endpoints` is a `ConcurrentHashMap`, so the read is already thread-safe.
    
    ### Does this PR resolve a correctness bug?
    
    - [ ] Yes
    
    ### Does this PR introduce _any_ user-facing change?
    
    - [ ] Yes
    
    ### How was this patch tested?
    Existing UTs.
    
    Closes #3840 from yew1eb/CELEBORN-2455.
    
    Authored-by: yew1eb <[email protected]>
    Signed-off-by: zhengtao <[email protected]>
    
    AI-Contributed/Feature: 0/4
    AI-Contributed/UT: 0/0
---
 .../main/scala/org/apache/celeborn/common/rpc/netty/Dispatcher.scala  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git 
a/common/src/main/scala/org/apache/celeborn/common/rpc/netty/Dispatcher.scala 
b/common/src/main/scala/org/apache/celeborn/common/rpc/netty/Dispatcher.scala
index d8282a64c7..6797dd3c5b 100644
--- 
a/common/src/main/scala/org/apache/celeborn/common/rpc/netty/Dispatcher.scala
+++ 
b/common/src/main/scala/org/apache/celeborn/common/rpc/netty/Dispatcher.scala
@@ -171,9 +171,7 @@ private[celeborn] class Dispatcher(nettyEnv: NettyRpcEnv, 
rpcSource: RpcSource)
       endpointName: String,
       message: InboxMessage,
       callbackIfStopped: Exception => Unit): Unit = {
-    val data = synchronized {
-      endpoints.get(endpointName)
-    }
+    val data = endpoints.get(endpointName)
     if (data != null) {
       data.inbox.waitOnFull()
     }

Reply via email to