vanzin commented on a change in pull request #23698: [SPARK-26766][CORE] Remove
the list of filesystems from
HadoopDelegationTokenProvider.obtainDelegationTokens
URL: https://github.com/apache/spark/pull/23698#discussion_r252445637
##########
File path:
core/src/main/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProvider.scala
##########
@@ -133,3 +133,45 @@ private[deploy] class HadoopFSDelegationTokenProvider
if (renewIntervals.isEmpty) None else Some(renewIntervals.min)
}
}
+
+private[deploy] object HadoopFSDelegationTokenProvider {
+ def hadoopFSsToAccess(
+ sparkConf: SparkConf,
+ hadoopConf: Configuration): Set[FileSystem] = {
+ val filesystemsToAccess = sparkConf.get(FILESYSTEMS_TO_ACCESS)
+ val requestAllDelegationTokens = filesystemsToAccess.isEmpty
+
+ val master = sparkConf.get("spark.master")
+ val stagingFS = if (master != null && master.contains("yarn")) {
+ sparkConf.get(STAGING_DIR)
+ .map(new Path(_).getFileSystem(hadoopConf))
+ .getOrElse(FileSystem.get(hadoopConf))
+ } else {
Review comment:
The docs for `FILESYSTEMS_TO_ACCESS` mention that `fs,defaultFS` does not
need to be added, which means that instead of this else, you should always add
the default FS to the list.
This was a bug in the previous code, probably never caught because it's
very, very unusual to store the staging dir in a different fs.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]