diff --git a/core/src/main/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProvider.scala b/core/src/main/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProvider.scala index b47f9e5a43af..fc750b54d0b8 100644 --- a/core/src/main/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProvider.scala +++ b/core/src/main/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProvider.scala @@ -150,6 +150,9 @@ private[deploy] class HadoopFSDelegationTokenProvider val interval = newExpiration - getIssueDate(tokenKind, identifier) logInfo(log"Renewal interval is ${MDC(TOTAL_TIME, interval)} for" + log" token ${MDC(TOKEN_KIND, tokenKind)}") + // The token here is only used to obtain renewal intervals. We should cancel it in + // a timely manner to avoid causing additional pressure on the server. + token.cancel(hadoopConf) interval }.toOption }