Skip to content

Commit 7715ad5

Browse files
committed
Add exponential delay time retry
1 parent 2aa5d26 commit 7715ad5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/scheduler/src/main/scala/org/apache/openwhisk/core/scheduler/container/CreationJobManager.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class CreationJobManager(feedFactory: (ActorRefFactory, String, String, Int, Arr
5252
private implicit val ec: ExecutionContext = actorSystem.dispatcher
5353
private val baseTimeout = loadConfigOrThrow[FiniteDuration](ConfigKeys.schedulerInProgressJobRetention)
5454
private val retryLimit = 5
55-
private val retryDelayTime = 100.milliseconds
5655

5756
/**
5857
* Store a JobEntry in local to get an alarm for key timeout
@@ -110,7 +109,8 @@ class CreationJobManager(feedFactory: (ActorRefFactory, String, String, Int, Arr
110109
logging.error(
111110
this,
112111
s"[$action] [$creationId] Failed to create container $retryCount/$retryLimit times for $cause. Started rescheduling")
113-
// Add some time interval during retry create container, because etcd put operation needs some time if data inconsistant happens
112+
// Add some exponential delay time interval during retry create container, because etcd put operation needs some time if data inconsistant happens
113+
val retryDelayTime = (scala.math.pow(2, retryCount) * 100).milliseconds
114114
actorSystem.scheduler.scheduleOnce(retryDelayTime) {
115115
context.parent ! ReschedulingCreationJob(
116116
tid,

0 commit comments

Comments
 (0)