Skip to content

Commit 889fcc4

Browse files
author
OpenShift Bot
authored
Merge pull request #13603 from kargakis/update-retry-count
Merged by openshift-bot
2 parents b0710d4 + 7d3326f commit 889fcc4

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

pkg/deploy/controller/deployment/controller.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ import (
2222

2323
// maxRetryCount is the maximum number of times the controller will retry errors.
2424
// The first requeue is after 5ms and subsequent requeues grow exponentially.
25-
// This effectively can extend up to 5^10ms which caps to 1000s:
25+
// This effectively can extend up to 5*2^14ms which caps to 82s:
26+
//
27+
// 5ms, 10ms, 20ms, 40ms, 80ms, 160ms, 320ms, 640ms, 1.3s, 2.6s, 5.1s, 10.2s, 20.4s, 41s, 82s
2628
//
27-
// 5ms, 25ms, 125ms, 625ms, 3s, 16s, 78s, 390s, 1000s, 1000s
2829
//
2930
// The most common errors are:
3031
//
@@ -33,7 +34,7 @@ import (
3334
// * pod may be missing from the cache once the deployment transitions to Pending.
3435
//
3536
// In most cases, we shouldn't need to retry up to maxRetryCount...
36-
const maxRetryCount = 10
37+
const maxRetryCount = 15
3738

3839
// fatalError is an error which can't be retried.
3940
type fatalError string

pkg/deploy/controller/deploymentconfig/controller.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ import (
2424
deployutil "github.com/openshift/origin/pkg/deploy/util"
2525
)
2626

27+
const (
28+
// maxRetryCount is the number of times a deployment config will be retried before it is dropped out
29+
// of the queue.
30+
maxRetryCount = 15
31+
)
32+
2733
// fatalError is an error which can't be retried.
2834
type fatalError string
2935

@@ -389,13 +395,14 @@ func (c *DeploymentConfigController) handleErr(err error, key interface{}) {
389395
return
390396
}
391397

392-
if c.queue.NumRequeues(key) < MaxRetries {
398+
if c.queue.NumRequeues(key) < maxRetryCount {
393399
glog.V(2).Infof("Error syncing deployment config %v: %v", key, err)
394400
c.queue.AddRateLimited(key)
395401
return
396402
}
397403

398404
utilruntime.HandleError(err)
405+
glog.V(2).Infof("Dropping deployment config %q out of the queue: %v", key, err)
399406
c.queue.Forget(key)
400407
}
401408

pkg/deploy/controller/deploymentconfig/factory.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ const (
2424
// controller stores have synced. If it hasn't synced, to avoid a hot loop, we'll wait this long
2525
// between checks.
2626
storeSyncedPollPeriod = 100 * time.Millisecond
27-
// MaxRetries is the number of times a deployment config will be retried before it is dropped out
28-
// of the queue.
29-
MaxRetries = 5
3027
)
3128

3229
// NewDeploymentConfigController creates a new DeploymentConfigController.

pkg/deploy/controller/generictrigger/controller.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ import (
1212
deployapi "github.com/openshift/origin/pkg/deploy/api"
1313
)
1414

15+
const (
16+
// maxRetryCount is the number of times a deployment config will be retried before it is dropped
17+
// out of the queue.
18+
maxRetryCount = 15
19+
)
20+
1521
// DeploymentTriggerController processes all triggers for a deployment config
1622
// and kicks new deployments whenever possible.
1723
type DeploymentTriggerController struct {
@@ -56,12 +62,13 @@ func (c *DeploymentTriggerController) handleErr(err error, key interface{}) {
5662
return
5763
}
5864

59-
if c.queue.NumRequeues(key) < MaxRetries {
65+
if c.queue.NumRequeues(key) < maxRetryCount {
6066
glog.V(2).Infof("Error instantiating deployment config %v: %v", key, err)
6167
c.queue.AddRateLimited(key)
6268
return
6369
}
6470

6571
utilruntime.HandleError(err)
72+
glog.V(2).Infof("Dropping deployment config %q out of the trigger queue: %v", key, err)
6673
c.queue.Forget(key)
6774
}

pkg/deploy/controller/generictrigger/factory.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ const (
2424
// stream stores have synced. If it hasn't synced, to avoid a hot loop, we'll wait this long
2525
// between checks.
2626
storeSyncedPollPeriod = 100 * time.Millisecond
27-
// MaxRetries is the number of times a deployment config will be retried before it is dropped
28-
// out of the queue.
29-
MaxRetries = 5
3027
)
3128

3229
// NewDeploymentTriggerController returns a new DeploymentTriggerController.

0 commit comments

Comments
 (0)