turboFei commented on code in PR #2962:
URL: https://github.com/apache/celeborn/pull/2962#discussion_r1881540619


##########
client/src/main/scala/org/apache/celeborn/client/CommitManager.scala:
##########
@@ -114,17 +114,23 @@ class CommitManager(appUniqueId: String, val conf: 
CelebornConf, lifecycleManage
 
                     if (workerToRequests.nonEmpty) {
                       val commitFilesFailedWorkers = new ShuffleFailedWorkers()
+                      val workerInfoSnapshots =
+                        
lifecycleManager.shuffleAllocatedWorkers.get(shuffleId).keySet().asScala
+                          .map(worker => worker.toUniqueId() -> worker).toMap
+                      def getWorkerInfo(worker: WorkerInfo): WorkerInfo = {
+                        workerInfoSnapshots.get(worker.toUniqueId()).getOrElse(
+                          lifecycleManager.shuffleAllocatedWorkers
+                            .get(shuffleId)
+                            .asScala
+                            .find(_._1.equals(worker))
+                            .get
+                            ._1)
+                      }
                       try {
                         val params = new 
ArrayBuffer[CommitFilesParam](workerToRequests.size)
                         workerToRequests.foreach {
                           case (worker, requests) =>
-                            val workerInfo =
-                              lifecycleManager.shuffleAllocatedWorkers
-                                .get(shuffleId)
-                                .asScala
-                                .find(_._1.equals(worker))
-                                .get
-                                ._1
+                            val workerInfo = getWorkerInfo(worker)

Review Comment:
   I used workerId as key in https://github.com/apache/celeborn/pull/2870



-- 
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