Skip to content

Commit 36eb8a9

Browse files
Change the renewal interval config param. Fix a bunch of comments.
1 parent 611923a commit 36eb8a9

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

core/src/main/scala/org/apache/spark/deploy/SparkHadoopUtil.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ class SparkHadoopUtil extends Logging {
242242
fraction: Double,
243243
credentials: Credentials): Long = {
244244
val now = System.currentTimeMillis()
245-
val renewalInterval = sparkConf.getLong("spark.yarn.renewal.interval", (24 hours).toMillis)
245+
246+
val renewalInterval =
247+
sparkConf.getLong("spark.yarn.token.renewal.interval", (24 hours).toMillis)
248+
246249
credentials.getAllTokens.filter(_.getKind == DelegationTokenIdentifier.HDFS_DELEGATION_KIND)
247250
.map { t =>
248251
val identifier = new DelegationTokenIdentifier()

core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ private[spark] object CoarseGrainedExecutorBackend extends Logging {
192192
workerUrl.foreach { url =>
193193
env.rpcEnv.setupEndpoint("WorkerWatcher", new WorkerWatcher(env.rpcEnv, url))
194194
}
195-
tokenUpdaterOption.foreach(_.stop())
196195
env.rpcEnv.awaitTermination()
196+
tokenUpdaterOption.foreach(_.stop())
197197
}
198198
}
199199

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ private[yarn] class AMDelegationTokenRenewer(
6464
/**
6565
* Schedule a login from the keytab and principal set using the --principal and --keytab
6666
* arguments to spark-submit. This login happens only when the credentials of the current user
67-
* are about to expire. This method reads SPARK_PRINCIPAL and SPARK_KEYTAB from the environment
68-
* to do the login. This method is a no-op in non-YARN mode.
67+
* are about to expire. This method reads spark.yarn.principal and spark.yarn.keytab from
68+
* SparkConf to do the login. This method is a no-op in non-YARN mode.
69+
*
6970
*/
7071
private[spark] def scheduleLoginFromKeytab(): Unit = {
7172
val principal = sparkConf.get("spark.yarn.principal")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ private[spark] class Client(
444444
"spark.yarn.credentials.file", new Path(stagingDirPath, credentialsFile).toString)
445445
logInfo(s"Credentials file set to: $credentialsFile")
446446
val renewalInterval = getTokenRenewalInterval(stagingDirPath)
447-
sparkConf.set("spark.yarn.renewal.interval", renewalInterval.toString)
447+
sparkConf.set("spark.yarn.token.renewal.interval", renewalInterval.toString)
448448
}
449449
// Set the environment variables to be passed on to the executors.
450450
distCacheMgr.setDistFilesEnv(env)

0 commit comments

Comments
 (0)