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

angerszhuuuu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 17ae0cd9b [CELEBORN-541][FOLLOWUP] handleGetReducerFileGroup occupy 
too much RPC thread cause other RPC can't been handled (#1448)
17ae0cd9b is described below

commit 17ae0cd9b12bebb9736a5c51b0fda500c8a9b21a
Author: Angerszhuuuu <[email protected]>
AuthorDate: Sun Apr 23 10:15:41 2023 +0800

    [CELEBORN-541][FOLLOWUP] handleGetReducerFileGroup occupy too much RPC 
thread cause other RPC can't been handled (#1448)
    
    * [CELEBORN-541][PERF] handleGetReducerFileGroup occupy too much RPC thread 
cause other RPC can't been handled
---
 .../client/commit/ReducePartitionCommitHandler.scala  | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git 
a/client/src/main/scala/org/apache/celeborn/client/commit/ReducePartitionCommitHandler.scala
 
b/client/src/main/scala/org/apache/celeborn/client/commit/ReducePartitionCommitHandler.scala
index 40c89a1df..517770bf9 100644
--- 
a/client/src/main/scala/org/apache/celeborn/client/commit/ReducePartitionCommitHandler.scala
+++ 
b/client/src/main/scala/org/apache/celeborn/client/commit/ReducePartitionCommitHandler.scala
@@ -98,8 +98,14 @@ class ReducePartitionCommitHandler(
     getReducerFileGroupRequest synchronized {
       stageEndShuffleSet.add(shuffleId)
     }
-    getReducerFileGroupRequest.remove(shuffleId)
-      .asScala.foreach(replyGetReducerFileGroup(_, shuffleId))
+
+    val requests = getReducerFileGroupRequest.remove(shuffleId)
+    // Set empty HashSet during register shuffle.
+    // In case of stage with no shuffle data, register shuffle will not be 
called,
+    // so here we still need to check null.
+    if (requests != null && !requests.isEmpty) {
+      requests.asScala.foreach(replyGetReducerFileGroup(_, shuffleId))
+    }
   }
 
   override def removeExpiredShuffle(shuffleId: Int): Unit = {
@@ -242,6 +248,7 @@ class ReducePartitionCommitHandler(
 
   override def registerShuffle(shuffleId: Int, numMappers: Int): Unit = {
     super.registerShuffle(shuffleId, numMappers)
+    getReducerFileGroupRequest.put(shuffleId, new 
util.HashSet[RpcCallContext]())
     initMapperAttempts(shuffleId, numMappers)
   }
 
@@ -296,13 +303,7 @@ class ReducePartitionCommitHandler(
         if (isStageEnd(shuffleId)) {
           replyGetReducerFileGroup(context, shuffleId)
         } else {
-          if (getReducerFileGroupRequest.contains(shuffleId)) {
-            getReducerFileGroupRequest.get(shuffleId).add(context)
-          } else {
-            val set = new util.HashSet[RpcCallContext]()
-            set.add(context)
-            getReducerFileGroupRequest.put(shuffleId, set)
-          }
+          getReducerFileGroupRequest.get(shuffleId).add(context)
         }
       }
     }

Reply via email to