dongjoon-hyun commented on code in PR #57675:
URL: https://github.com/apache/spark/pull/57675#discussion_r3706603832


##########
core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala:
##########
@@ -1047,6 +1061,46 @@ class CoarseGrainedSchedulerBackend(scheduler: 
TaskSchedulerImpl, val rpcEnv: Rp
 
   protected def currentDelegationTokens: Array[Byte] = delegationTokens.get()
 
+  /**
+   * Update user credentials and broadcast to all registered executors.
+   * Called from the DriverEndpoint receive loop (thread-safe access to 
executorDataMap).
+   */
+  private def updateUserCredentials(credentials: Array[Byte]): Unit = {
+    userCredentials.set(credentials)
+    // Also update driver's SparkEnv so TaskDescription can include current 
credentials.
+    SparkEnv.get.userCredentials.set(credentials)
+    executorDataMap.values.foreach { ed =>
+      ed.executorEndpoint.send(UpdateUserCredentials(credentials))
+    }
+  }
+
+  protected def currentUserCredentials: Array[Byte] = userCredentials.get()
+

Review Comment:
   `currentUserCredentials` has no callers. Its sibling 
`currentDelegationTokens` is actually used by `YarnSchedulerBackend`, but 
nothing uses this one yet. If no follow-up sub-task needs it, shall we remove 
it and add it back when needed?
   
   ```suggestion
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to