Skip to content

Commit

Permalink
Increase claim scheduling and defaulting max jitter to 1.5 seconds
Browse files Browse the repository at this point in the history
200ms seems low enough that GCP consistently beats Azure when scheduling
RedisCluster claims in my experiments.

Signed-off-by: Nic Cope <[email protected]>
  • Loading branch information
negz committed Oct 22, 2019
1 parent aafb516 commit 8faf79f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions pkg/resource/claim_defaulting_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ import (
)

const (
claimDefaultingControllerName = "resourceclaimdefaulter.crossplane.io"
claimDefaultingReconcileTimeout = 1 * time.Minute
claimDefaultingControllerName = "resourceclaimdefaulter.crossplane.io"
claimDefaultingReconcileTimeout = 1 * time.Minute
claimDefaultingReconcileMaxJitterMs = 1500
)

// A ClaimDefaultingReconciler reconciles resource claims by setting their
Expand Down Expand Up @@ -75,7 +76,7 @@ func NewClaimDefaultingReconciler(m manager.Manager, of ClaimKind, to ClassKind,
classKind: to,
jitter: func() {
random := rand.New(rand.NewSource(time.Now().UnixNano()))
time.Sleep(time.Duration(random.Intn(200)) * time.Millisecond)
time.Sleep(time.Duration(random.Intn(claimDefaultingReconcileMaxJitterMs)) * time.Millisecond)
},
}

Expand Down
7 changes: 4 additions & 3 deletions pkg/resource/claim_scheduling_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ import (
)

const (
claimSchedulingControllerName = "resourceclaimscheduler.crossplane.io"
claimSchedulingReconcileTimeout = 1 * time.Minute
claimSchedulingControllerName = "resourceclaimscheduler.crossplane.io"
claimSchedulingReconcileTimeout = 1 * time.Minute
claimSchedulingReconcileMaxJitterMs = 1500
)

const (
Expand Down Expand Up @@ -85,7 +86,7 @@ func NewClaimSchedulingReconciler(m manager.Manager, of ClaimKind, to ClassKind,
classKind: to,
jitter: func() {
random := rand.New(rand.NewSource(time.Now().UnixNano()))
time.Sleep(time.Duration(random.Intn(200)) * time.Millisecond)
time.Sleep(time.Duration(random.Intn(claimSchedulingReconcileMaxJitterMs)) * time.Millisecond)
},
}

Expand Down

0 comments on commit 8faf79f

Please sign in to comment.