SAMZA-929: Set initialDelay in tokenRenewExecutor schedule to 0
authorApoorva Sareen <asareen@MacBook-Pro-2.local>
Tue, 5 Jun 2018 18:44:49 +0000 (11:44 -0700)
committerJagadish <jvenkatraman@linkedin.com>
Tue, 5 Jun 2018 18:44:49 +0000 (11:44 -0700)
Changed initialDelay in tokenRenewExecutor scheduler to 0 so that it can re-login using the keytab as soon as the application master container starts.  This way even if application master restarts after the delegation token in launcher context has expired, it will be able to use the new token to launch other containers.

Author: Apoorva Sareen <asareen@MacBook-Pro-2.local>

Reviewers: Jagadish<jagadish@apache.org>

Closes #544 from apoorva121/master

samza-yarn/src/main/scala/org/apache/samza/job/yarn/SamzaAppMasterSecurityManager.scala

index 185cda0..bb590c5 100644 (file)
@@ -74,7 +74,7 @@ class SamzaAppMasterSecurityManager(config: Config, hadoopConf: Configuration) e
       }
     }
 
-    tokenRenewExecutor.scheduleAtFixedRate(tokenRenewRunnable, renewalInterval, renewalInterval, TimeUnit.SECONDS)
+    tokenRenewExecutor.scheduleAtFixedRate(tokenRenewRunnable, 0, renewalInterval, TimeUnit.SECONDS)
   }
 
   private def loginFromKeytab(principal: String, keytab: String, credentialsFile: String) = {