You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid some status updates from being delayed to next sync
The writerlease is a work queue, but we were exiting immediately on
conflicts. This is not our normal pattern, which is to build a work
queue and then resync from the latest cache state. Change how status.go
queues up work so that we perform our retry inside the lease function.
Should ensure that the correct output is eventually written.
tracker.SetConflictMessage(fmt.Sprintf("The router detected another process is writing conflicting updates to route status with name %q. Please ensure that the configuration of all routers is consistent. Route status will not be updated as long as conflicts are detected.", o.RouterName))
tracker.SetConflictMessage(fmt.Sprintf("The router detected another process is writing conflicting updates to route status with name %q. Please ensure that the configuration of all routers is consistent. Route status will not be updated as long as conflicts are detected.", o.RouterName))
// if the router can't write status updates, allow the route to go through
158
+
utilruntime.HandleError(fmt.Errorf("Unable to write router status - please ensure you reconcile your system policy or grant this router access to update route status: %v", err))
159
+
tracker.Clear(key, latest)
160
+
returnwriterlease.Extend, false
161
+
caseerrors.IsNotFound(err):
162
+
// route was deleted
163
+
returnwriterlease.Release, false
164
+
caseerrors.IsConflict(err):
165
+
// just follow the normal process, and retry when we receive the update notification due to
166
+
// the other entity updating the route.
167
+
glog.V(4).Infof("%s: updating status of %s/%s failed due to write conflict", action, route.Namespace, route.Name)
168
+
returnwriterlease.Release, true
169
+
default:
170
+
utilruntime.HandleError(fmt.Errorf("Unable to write router status for %s/%s: %v", route.Namespace, route.Name, err))
171
+
attempts--
172
+
returnwriterlease.Release, attempts>0
139
173
}
140
-
returnupdated, false
141
174
})
142
175
}
143
176
144
177
// recordIngressCondition updates the matching ingress on the route (or adds a new one) with the specified
145
178
// condition, returning whether the route was updated or created, the time assigned to the condition, and
// if the router can't write status updates, allow the route to go through
240
-
utilruntime.HandleError(fmt.Errorf("Unable to write router status - please ensure you reconcile your system policy or grant this router access to update route status: %v", err))
241
-
returntrue
242
-
caseerrors.IsConflict(err):
243
-
// just follow the normal process, and retry when we receive the update notification due to
244
-
// the other entity updating the route.
245
-
glog.V(4).Infof("updating status of %s/%s failed due to write conflict", route.Namespace, route.Name)
246
-
returnfalse
247
-
default:
248
-
utilruntime.HandleError(fmt.Errorf("Unable to write router status for %s/%s: %v", route.Namespace, route.Name, err))
249
-
continue
250
-
}
251
-
}
252
-
returnfalse
253
-
}
254
-
255
263
// ContentionTracker records modifications to a particular entry to prevent endless
256
264
// loops when multiple routers are configured with conflicting info. A given router
257
265
// process tracks whether the ingress status is change from a correct value to any
0 commit comments