From d166e042be765108e01f4c55aaaddbf46af255d9 Mon Sep 17 00:00:00 2001 From: Keyong Zhou Date: Fri, 12 Aug 2022 12:27:27 +0800 Subject: [PATCH] [ISSUE-329] Should not sleep if reserve slots successfully in reserveSlotsWithRetry (#330) --- .../com/aliyun/emr/rss/client/write/LifecycleManager.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/main/scala/com/aliyun/emr/rss/client/write/LifecycleManager.scala b/client/src/main/scala/com/aliyun/emr/rss/client/write/LifecycleManager.scala index 50e681e15..5fb9fdd57 100644 --- a/client/src/main/scala/com/aliyun/emr/rss/client/write/LifecycleManager.scala +++ b/client/src/main/scala/com/aliyun/emr/rss/client/write/LifecycleManager.scala @@ -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) {