Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5307#discussion_r27931210
--- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala ---
@@ -534,12 +538,51 @@ private[spark] class Client(
// send the acl settings into YARN to control who has access via YARN
interfaces
val securityManager = new SecurityManager(sparkConf)
amContainer.setApplicationACLs(YarnSparkHadoopUtil.getApplicationAclsForYarn(securityManager))
+ val isEncryptedShuffle = if (sparkConf != null) {
+ sparkConf.getBoolean("spark.encrypted.shuffle", false)
+ } else {
+ false
+ }
+ if (isEncryptedShuffle) {
+ setSparkShuffleTokens(credentials, amContainer)
+ // amContainer.setEnvironment() set the LD_LIBRARY_PATH like
"xxx.so" here
+ }
setupSecurityToken(amContainer)
UserGroupInformation.getCurrentUser().addCredentials(credentials)
amContainer
}
+ def
setSparkShuffleTokens(credentials:Credentials,amContainer:ContainerLaunchContext){
+ if (TokenCache.getShuffleSecretKey(credentials) == null) {
+ var keyGen: KeyGenerator = null
+ try {
+ val SHUFFLE_KEY_LENGTH: Int = 64
+ var keyLen: Int = if
(sparkConf.getBoolean(SPARK_ENCRYPTED_INTERMEDIATE_DATA,
+ DEFAULT_SPARK_ENCRYPTED_INTERMEDIATE_DATA) == true) {
+ sparkConf.getInt(SPARK_ENCRYPTED_INTERMEDIATE_DATA_KEY_SIZE_BITS,
+ DEFAULT_SPARK_ENCRYPTED_INTERMEDIATE_DATA_KEY_SIZE_BITS)
+ }
+ else {
+ SHUFFLE_KEY_LENGTH
+ }
+ val SHUFFLE_KEYGEN_ALGORITHM = "HmacSHA1"
+ keyGen = KeyGenerator.getInstance(SHUFFLE_KEYGEN_ALGORITHM)
+ keyGen.init(keyLen)
+ }
+ catch {
+ case e: NoSuchAlgorithmException => println("Error generating
shuffle secret key")
--- End diff --
Another case of broken error handling.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]