cmssczy commented on issue #806:
URL:
https://github.com/apache/apisix-ingress-controller/issues/806#issuecomment-1059743332
I think the resources (located in `/pkg/ingress/xxx.go`.) that follow the
logic below will be affected.
```go
func (c *xxxController) runWorker(ctx context.Context) {
for {
obj, quit := c.workqueue.Get()
if quit {
return
}
err := c.sync(ctx, obj.(*types.Event))
c.workqueue.Done(obj)
// The obj may be expired at this time,
// so it maybe lead to unexpected result after we requeue
obj into workqueue.
c.handleSyncErr(obj, err)
}
}
func (c *apisixClusterConfigController) sync(ctx context.Context, ev
*types.Event) error {
// ...
// do something using `ev` , eg.
nodes, err := c.translator.TranslateUpstreamNodes(ep, port.Port,
subset.Labels)
// ...
}
func (c *apisixUpstreamController) handleSyncErr(obj interface{}, err error)
{
// ...
// add obj but not the latest obj to workquque again.
c.workqueue.AddRateLimited(obj)
// ...
}
```
These resources include
`ApisixClusterConfig`/`ApisixConsumer`/`ApisixPluginConfig`/`ApisixRoute`/`ApisixTls`/`ApisixUpstream`/`endpoints`/`Gateway`/`Ingress`/`Namespace`/`Secret`.
`endpointSlice` resource is not affected because we get the latest ep
everytime instead of using the object poped from the workquque(`*types.Event`)
https://github.com/apache/apisix-ingress-controller/blob/b5448c37e7b043b4d2a5b5d35b115429a20760a0/pkg/ingress/endpointslice.go#L100-L106
`pod` resource is aslo not affected because we did not use workquque at all.
Correct me if I'm wrong. @tao12345666333
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]