[ISSUE-329] Should not sleep if reserve slots successfully in reserveSlotsWithRetry (#330)

This commit is contained in:
Keyong Zhou 2022-08-12 12:27:27 +08:00 committed by GitHub
parent 46cbe4fb04
commit d166e042be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -956,6 +956,9 @@ class LifecycleManager(appId: String, val conf: RssConf) extends RpcEndpoint wit
var noAvailableSlots = false
var success = false
while (retryTimes <= maxRetryTimes && !success && !noAvailableSlots) {
if (retryTimes > 1) {
Thread.sleep(retryWaitInterval)
}
// reserve buffers
logInfo(s"Try reserve slots for ${Utils.makeShuffleKey(applicationId, shuffleId)} " +
s"for $retryTimes times.")
@ -999,7 +1002,6 @@ class LifecycleManager(appId: String, val conf: RssConf) extends RpcEndpoint wit
}
}
retryTimes += 1
Thread.sleep(retryWaitInterval)
}
// if failed after retry, destroy all allocated buffers
if (!success) {