Skip to content

Commit 61d729a

Browse files
Subroto SanyalMarcelo Vanzin
authored andcommitted
[SPARK-15754][YARN] Not letting the credentials containing hdfs delegation 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 <ssanyal@datameer.com> Closes apache#13499 from subrotosanyal/SPARK-15754-save-ugi-from-changing.
1 parent 3074f57 commit 61d729a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • yarn/src/main/scala/org/apache/spark/deploy/yarn

yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,6 @@ private[spark] class Client(
980980
amContainer.setApplicationACLs(
981981
YarnSparkHadoopUtil.getApplicationAclsForYarn(securityManager).asJava)
982982
setupSecurityToken(amContainer)
983-
UserGroupInformation.getCurrentUser().addCredentials(credentials)
984983

985984
amContainer
986985
}
@@ -1001,7 +1000,8 @@ private[spark] class Client(
10011000
sparkConf.set(KEYTAB.key, keytabFileName)
10021001
sparkConf.set(PRINCIPAL.key, principal)
10031002
}
1004-
credentials = UserGroupInformation.getCurrentUser.getCredentials
1003+
// Defensive copy of the credentials
1004+
credentials = new Credentials(UserGroupInformation.getCurrentUser.getCredentials)
10051005
}
10061006

10071007
/**

0 commit comments

Comments
 (0)