Skip to content

Commit f02a182

Browse files
committed
fix(nodeclaim): sleep for each reconciliation of consolidation controller
Signed-off-by: flavono123 <[email protected]>
1 parent 155c1ec commit f02a182

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/controllers/nodeclaim/disruption/consolidation.go

-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package disruption
1818

1919
import (
2020
"context"
21-
"time"
2221

2322
"github.com/samber/lo"
2423
"k8s.io/utils/clock"
@@ -73,10 +72,6 @@ func (c *Consolidation) Reconcile(ctx context.Context, nodePool *v1.NodePool, no
7372
// 3. Otherwise, add the consolidatable status condition if not already set
7473
if !hasConsolidatableCondition {
7574
nodeClaim.StatusConditions().SetTrue(v1.ConditionTypeConsolidatable)
76-
// We sleep here after a set operation since we want to ensure that we are able to read our own writes
77-
// so that we avoid duplicating log lines due to quick re-queues from our node watcher
78-
time.Sleep(100 * time.Millisecond)
79-
8075
log.FromContext(ctx).V(1).Info("marking consolidatable")
8176
}
8277
return reconcile.Result{}, nil

pkg/controllers/nodeclaim/disruption/controller.go

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package disruption
1818

1919
import (
2020
"context"
21+
"time"
2122

2223
"go.uber.org/multierr"
2324
corev1 "k8s.io/api/core/v1"
@@ -110,6 +111,10 @@ func (c *Controller) Reconcile(ctx context.Context, nodeClaim *v1.NodeClaim) (re
110111
}
111112
return reconcile.Result{}, client.IgnoreNotFound(err)
112113
}
114+
// We sleep here after a patch operation since we want to ensure that we are able to read our own writes
115+
// so that we avoid duplicating metrics and log lines due to quick re-queues from our node watcher
116+
// USE CAUTION when determining whether to increase this timeout or remove this line
117+
time.Sleep(time.Second)
113118
}
114119
if errs != nil {
115120
return reconcile.Result{}, errs

0 commit comments

Comments
 (0)