Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: If resource synchronization retry occurs, other events of the same resource will be blocked. #760

Merged
merged 1 commit into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/ingress/apisix_cluster_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (c *apisixClusterConfigController) onAdd(obj interface{}) {
zap.Any("object", obj),
)

c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventAdd,
Object: key,
})
Expand All @@ -229,7 +229,7 @@ func (c *apisixClusterConfigController) onUpdate(oldObj, newObj interface{}) {
zap.Any("old object", prev),
)

c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventUpdate,
Object: key,
})
Expand All @@ -253,7 +253,7 @@ func (c *apisixClusterConfigController) onDelete(obj interface{}) {
log.Debugw("ApisixClusterConfig delete event arrived",
zap.Any("final state", acc),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventDelete,
Object: key,
Tombstone: acc,
Expand Down
6 changes: 3 additions & 3 deletions pkg/ingress/apisix_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (c *apisixConsumerController) onAdd(obj interface{}) {
zap.Any("object", obj),
)

c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventAdd,
Object: key,
})
Expand All @@ -190,7 +190,7 @@ func (c *apisixConsumerController) onUpdate(oldObj, newObj interface{}) {
zap.Any("old object", prev),
)

c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventUpdate,
Object: key,
})
Expand All @@ -217,7 +217,7 @@ func (c *apisixConsumerController) onDelete(obj interface{}) {
log.Debugw("ApisixConsumer delete event arrived",
zap.Any("final state", ac),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventDelete,
Object: key,
Tombstone: ac,
Expand Down
6 changes: 3 additions & 3 deletions pkg/ingress/apisix_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func (c *apisixRouteController) onAdd(obj interface{}) {
zap.Any("object", obj))

ar := kube.MustNewApisixRoute(obj)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventAdd,
Object: kube.ApisixRouteEvent{
Key: key,
Expand All @@ -357,7 +357,7 @@ func (c *apisixRouteController) onUpdate(oldObj, newObj interface{}) {
zap.Any("new object", curr),
zap.Any("old object", prev),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventUpdate,
Object: kube.ApisixRouteEvent{
Key: key,
Expand Down Expand Up @@ -387,7 +387,7 @@ func (c *apisixRouteController) onDelete(obj interface{}) {
log.Debugw("ApisixRoute delete event arrived",
zap.Any("final state", ar),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventDelete,
Object: kube.ApisixRouteEvent{
Key: key,
Expand Down
6 changes: 3 additions & 3 deletions pkg/ingress/apisix_tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (c *apisixTlsController) onAdd(obj interface{}) {
log.Debugw("ApisixTls add event arrived",
zap.Any("object", obj),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventAdd,
Object: key,
})
Expand All @@ -219,7 +219,7 @@ func (c *apisixTlsController) onUpdate(prev, curr interface{}) {
zap.Any("new object", curr),
zap.Any("old object", prev),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventUpdate,
Object: key,
})
Expand Down Expand Up @@ -248,7 +248,7 @@ func (c *apisixTlsController) onDelete(obj interface{}) {
log.Debugw("ApisixTls delete event arrived",
zap.Any("final state", obj),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventDelete,
Object: key,
Tombstone: tls,
Expand Down
6 changes: 3 additions & 3 deletions pkg/ingress/apisix_upstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (c *apisixUpstreamController) onAdd(obj interface{}) {
log.Debugw("ApisixUpstream add event arrived",
zap.Any("object", obj))

c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventAdd,
Object: key,
})
Expand All @@ -250,7 +250,7 @@ func (c *apisixUpstreamController) onUpdate(oldObj, newObj interface{}) {
zap.Any("old object", prev),
)

c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventUpdate,
Object: key,
})
Expand All @@ -277,7 +277,7 @@ func (c *apisixUpstreamController) onDelete(obj interface{}) {
log.Debugw("ApisixUpstream delete event arrived",
zap.Any("final state", au),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventDelete,
Object: key,
Tombstone: au,
Expand Down
6 changes: 3 additions & 3 deletions pkg/ingress/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (c *endpointsController) onAdd(obj interface{}) {
log.Debugw("endpoints add event arrived",
zap.String("object-key", key))

c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventAdd,
// TODO pass key.
Object: kube.NewEndpoint(obj.(*corev1.Endpoints)),
Expand All @@ -138,7 +138,7 @@ func (c *endpointsController) onUpdate(prev, curr interface{}) {
zap.Any("new object", currEp),
zap.Any("old object", prevEp),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventUpdate,
// TODO pass key.
Object: kube.NewEndpoint(currEp),
Expand All @@ -165,7 +165,7 @@ func (c *endpointsController) onDelete(obj interface{}) {
log.Debugw("endpoints delete event arrived",
zap.Any("final state", ep),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventDelete,
Object: kube.NewEndpoint(ep),
})
Expand Down
6 changes: 3 additions & 3 deletions pkg/ingress/endpointslice.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (c *endpointSliceController) onAdd(obj interface{}) {
zap.String("object-key", key),
)

c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventAdd,
Object: endpointSliceEvent{
Key: key,
Expand Down Expand Up @@ -180,7 +180,7 @@ func (c *endpointSliceController) onUpdate(prev, curr interface{}) {
zap.Any("new object", currEp),
zap.Any("old object", prevEp),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventUpdate,
// TODO pass key.
Object: endpointSliceEvent{
Expand Down Expand Up @@ -217,7 +217,7 @@ func (c *endpointSliceController) onDelete(obj interface{}) {
log.Debugw("endpoints delete event arrived",
zap.Any("object-key", key),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventDelete,
Object: endpointSliceEvent{
Key: key,
Expand Down
6 changes: 3 additions & 3 deletions pkg/ingress/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (c *ingressController) onAdd(obj interface{}) {
return
}

c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventAdd,
Object: kube.IngressEvent{
Key: key,
Expand Down Expand Up @@ -253,7 +253,7 @@ func (c *ingressController) onUpdate(oldObj, newObj interface{}) {
return
}

c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventUpdate,
Object: kube.IngressEvent{
Key: key,
Expand Down Expand Up @@ -292,7 +292,7 @@ func (c *ingressController) OnDelete(obj interface{}) {
)
return
}
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventDelete,
Object: kube.IngressEvent{
Key: key,
Expand Down
6 changes: 3 additions & 3 deletions pkg/ingress/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (c *namespaceController) onAdd(obj interface{}) {
if err == nil {
log.Debugw(key)
}
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventAdd,
Object: key,
})
Expand All @@ -150,15 +150,15 @@ func (c *namespaceController) onUpdate(pre, cur interface{}) {
log.Errorf("found Namespace resource with error: %s", err)
return
}
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventUpdate,
Object: key,
})
}

func (c *namespaceController) onDelete(obj interface{}) {
namespace := obj.(*corev1.Namespace)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventDelete,
Object: namespace.Name,
Tombstone: namespace,
Expand Down
6 changes: 3 additions & 3 deletions pkg/ingress/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (c *secretController) onAdd(obj interface{}) {
log.Debugw("secret add event arrived",
zap.String("object-key", key),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventAdd,
Object: key,
})
Expand All @@ -267,7 +267,7 @@ func (c *secretController) onUpdate(prev, curr interface{}) {
zap.Any("new object", curr),
zap.Any("old object", prev),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventUpdate,
Object: key,
})
Expand Down Expand Up @@ -298,7 +298,7 @@ func (c *secretController) onDelete(obj interface{}) {
log.Debugw("secret delete event arrived",
zap.Any("final state", sec),
)
c.workqueue.AddRateLimited(&types.Event{
c.workqueue.Add(&types.Event{
Type: types.EventDelete,
Object: key,
Tombstone: sec,
Expand Down