Skip to content

Commit 15cf72f

Browse files
committed
Add retry for ll.Unlock()
1 parent 64ca9eb commit 15cf72f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/controller/ipaddress_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (r *IpAddressReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
201201
}
202202

203203
// 3. unlock lease of parent prefix
204-
if ll != nil {
204+
for i := 0; i < 5 && ll != nil; i++ {
205205
ll.Unlock()
206206
}
207207

internal/controller/iprange_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (r *IpRangeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
179179
}
180180

181181
// 3. unlock lease of parent prefix
182-
if ll != nil {
182+
for i := 0; i < 5 && ll != nil; i++ {
183183
ll.Unlock()
184184
}
185185

internal/controller/prefix_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (r *PrefixReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
216216
}
217217

218218
/* 3. unlock lease of parent prefix */
219-
if ll != nil {
219+
for i := 0; i < 5 && ll != nil; i++ {
220220
ll.Unlock()
221221
}
222222

0 commit comments

Comments
 (0)