Skip to content

Commit

Permalink
[SPARK-15754][YARN] Not letting the credentials containing hdfs deleg…
Browse files Browse the repository at this point in the history
…ation tokens to be added in current user credential.

## What changes were proposed in this pull request?
The credentials are not added to the credentials of UserGroupInformation.getCurrentUser(). Further if the client has possibility to login using keytab then the updateDelegationToken thread is not started on client.

## How was this patch tested?
ran dev/run-tests

Author: Subroto Sanyal <[email protected]>

Closes #13499 from subrotosanyal/SPARK-15754-save-ugi-from-changing.
  • Loading branch information
Subroto Sanyal authored and Marcelo Vanzin committed Jun 3, 2016
1 parent 3074f57 commit 61d729a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,6 @@ private[spark] class Client(
amContainer.setApplicationACLs(
YarnSparkHadoopUtil.getApplicationAclsForYarn(securityManager).asJava)
setupSecurityToken(amContainer)
UserGroupInformation.getCurrentUser().addCredentials(credentials)

amContainer
}
Expand All @@ -1001,7 +1000,8 @@ private[spark] class Client(
sparkConf.set(KEYTAB.key, keytabFileName)
sparkConf.set(PRINCIPAL.key, principal)
}
credentials = UserGroupInformation.getCurrentUser.getCredentials
// Defensive copy of the credentials
credentials = new Credentials(UserGroupInformation.getCurrentUser.getCredentials)
}

/**
Expand Down

0 comments on commit 61d729a

Please sign in to comment.