Github user vanzin commented on a diff in the pull request: https://github.com/apache/spark/pull/22624#discussion_r223815272 --- Diff: resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosHadoopDelegationTokenManager.scala --- @@ -34,15 +34,9 @@ private[spark] class MesosHadoopDelegationTokenManager( private val tokenManager = new HadoopDelegationTokenManager(sparkConf, hadoopConf) - def start(driverEndpoint: RpcEndpointRef): Unit = { - require(driverEndpoint != null, "DriverEndpoint is not initialized") - setDriverRef(driverEndpoint) - if (renewalEnabled) { - super.start() - } else { - logInfo("Using ticket cache for Kerberos authentication, no token renewal.") - createAndUpdateTokens() - } + override def start(driver: Option[RpcEndpointRef]): UserGroupInformation = { + require(driver.orNull != null, "Driver endpoint is not initialized") --- End diff -- `Some(null).isDefined` is true. And if you get initialization order wrong in these classes, you can get into that situation. So this is safer.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org