Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18616#discussion_r127294479
  
    --- Diff: 
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
 ---
    @@ -674,6 +671,43 @@ private[spark] class ApplicationMaster(
         allocatorLock.notifyAll()
       }
     
    +  private def startAMCredentialRenewer(): Unit = {
    +    // If the credentials file config is present, we must periodically 
renew tokens. So create
    +    // a new AMDelegationTokenRenewer
    +    if (sparkConf.contains(CREDENTIALS_FILE_PATH.key)) {
    +      // If a principal and keytab have been set, use that to create new 
credentials for executors
    +      // periodically
    +      val credentialManager = new YARNHadoopDelegationTokenManager(
    +        sparkConf,
    +        yarnConf,
    +        () => YarnSparkHadoopUtil.get.hadoopFSsToAccess(sparkConf, 
yarnConf))
    +
    +      val credentialRenewer = new AMCredentialRenewer(sparkConf, yarnConf, 
credentialManager)
    +      credentialRenewer.scheduleLoginFromKeytab()
    +    }
    +  }
    +
    +  private def startAMCredentialRenewerThread(): Thread = {
    --- End diff --
    
    Can you add comments explaining this is done so that `AMCredentialRenewer` 
picks up the custom class loader? This thread will be very short-lived, so it 
would be nice to explain why it's needed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to