aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubroto Sanyal <ssanyal@datameer.com>2016-06-03 16:50:00 -0700
committerMarcelo Vanzin <vanzin@cloudera.com>2016-06-03 16:50:00 -0700
commit61d729abdaf9bdd54aea74a643828d570b036d87 (patch)
treea91f3b45e33e58e31828f21376920734f1d6038f
parent3074f575a3c84108fddab3f5f56eb1929a4b2cff (diff)
downloadspark-61d729abdaf9bdd54aea74a643828d570b036d87.tar.gz
spark-61d729abdaf9bdd54aea74a643828d570b036d87.tar.bz2
spark-61d729abdaf9bdd54aea74a643828d570b036d87.zip
[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 #13499 from subrotosanyal/SPARK-15754-save-ugi-from-changing.
-rw-r--r--yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
index 598eb17d5d..9bb369549d 100644
--- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
+++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
@@ -980,7 +980,6 @@ private[spark] class Client(
amContainer.setApplicationACLs(
YarnSparkHadoopUtil.getApplicationAclsForYarn(securityManager).asJava)
setupSecurityToken(amContainer)
- UserGroupInformation.getCurrentUser().addCredentials(credentials)
amContainer
}
@@ -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)
}
/**