zaynt4606 commented on code in PR #3059:
URL: https://github.com/apache/celeborn/pull/3059#discussion_r1914457064


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Controller.scala:
##########
@@ -439,12 +446,13 @@ private[deploy] class Controller(
         return
       } else if (commitInfo.status == CommitInfo.COMMIT_INPROCESS) {
         logInfo(s"$shuffleKey CommitFiles inprogress, wait for finish")
-        // should not use commitThreadPool in case of block by commit files.
-        waitThreadPool.submit(new Runnable {
-          override def run(): Unit = {
-            waitForCommitFinish()
-          }
-        })
+        // Replace the ThreadPool to avoid blocking
+        // Read and write security of epoch in epochWaitTimeMap is guaranteed 
by commitInfo's lock
+        shuffleCommitTime.putIfAbsent(
+          shuffleKey,
+          JavaUtils.newConcurrentHashMap[Long, (Int, RpcCallContext)]())
+        val epochWaitTimeMap = shuffleCommitTime.get(shuffleKey)
+        epochWaitTimeMap.putIfAbsent(epoch, (0, context))

Review Comment:
   `context` is a parameter passed to `handleCommitFiles` and can not used by 
non `handleCommitFiles` internal functions



##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Controller.scala:
##########
@@ -52,32 +52,46 @@ private[deploy] class Controller(
   var shuffleMapperAttempts: ConcurrentHashMap[String, AtomicIntegerArray] = _
   // shuffleKey -> (epoch -> CommitInfo)
   var shuffleCommitInfos: ConcurrentHashMap[String, ConcurrentHashMap[Long, 
CommitInfo]] = _
+  var shuffleCommitTime: ConcurrentHashMap[String, ConcurrentHashMap[Long, 
(Int, RpcCallContext)]] =

Review Comment:
   Done~



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to