Skip to content
Snippets Groups Projects
Commit 1e978139 authored by echo2mei's avatar echo2mei Committed by Shixiong Zhu
Browse files

[SPARK-12396][CORE] Modify the function scheduleAtFixedRate to schedule.

Instead of just cancel the registrationRetryTimer to avoid driver retry connect to master, change the function to schedule.
It is no need to register to master iteratively.

Author: echo2mei <534384876@qq.com>

Closes #10447 from echoTomei/master.
parent ea4aab7e
No related branches found
No related tags found
No related merge requests found
......@@ -124,7 +124,7 @@ private[spark] class AppClient(
*/
private def registerWithMaster(nthRetry: Int) {
registerMasterFutures.set(tryRegisterAllMasters())
registrationRetryTimer.set(registrationRetryThread.scheduleAtFixedRate(new Runnable {
registrationRetryTimer.set(registrationRetryThread.schedule(new Runnable {
override def run(): Unit = {
Utils.tryOrExit {
if (registered.get) {
......@@ -138,7 +138,7 @@ private[spark] class AppClient(
}
}
}
}, REGISTRATION_TIMEOUT_SECONDS, REGISTRATION_TIMEOUT_SECONDS, TimeUnit.SECONDS))
}, REGISTRATION_TIMEOUT_SECONDS, TimeUnit.SECONDS))
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment