This is an automated email from the ASF dual-hosted git repository.

ashishtiwari pushed a commit to branch v1.8.0
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/v1.8.0 by this push:
     new cdc2cc9a release: cherry pick commit and add changelog for release 
1.8.3 (#2309)
cdc2cc9a is described below

commit cdc2cc9aec45d12f25184ad1c1ee8c6713e6df37
Author: Ashish Tiwari <[email protected]>
AuthorDate: Tue Oct 15 21:46:08 2024 +0530

    release: cherry pick commit and add changelog for release 1.8.3 (#2309)
---
 CHANGELOG.md                               | 13 +++++++++++++
 pkg/providers/apisix/apisix_global_rule.go | 11 +++++++----
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d7800ac8..733d92c2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@
 
 # Table of Contents
 
+- [1.8.3](#182)
 - [1.8.2](#182)
 - [1.8.1](#181)
 - [1.8.0](#180)
@@ -41,6 +42,18 @@
 - [0.2.0](#020)
 - [0.1.0](#010)
 
+# 1.8.3
+
+## What's New
+
+- fix: candidate controllers missing Forget call in workqueue @Revolyssup 
(#2308)
+
+## 👨🏽‍💻 Contributors
+
+Thank you to our contributors for making this release possible:
+@Revolyssup
+
+
 # 1.8.2
 
 ## What's New
diff --git a/pkg/providers/apisix/apisix_global_rule.go 
b/pkg/providers/apisix/apisix_global_rule.go
index 69b3d11f..4948543d 100644
--- a/pkg/providers/apisix/apisix_global_rule.go
+++ b/pkg/providers/apisix/apisix_global_rule.go
@@ -179,6 +179,13 @@ func (c *apisixGlobalRuleController) sync(ctx 
context.Context, ev *types.Event)
 }
 
 func (c *apisixGlobalRuleController) handleSyncErr(obj interface{}, errOrigin 
error) {
+       if errOrigin == nil {
+               c.MetricsCollector.IncrSyncOperation("GlobalRule", "success")
+               c.workqueue.Forget(obj)
+       } else {
+               c.workqueue.AddRateLimited(obj)
+               c.MetricsCollector.IncrSyncOperation("GlobalRule", "failure")
+       }
        ev := obj.(*types.Event)
        event := ev.Object.(kube.ApisixGlobalRuleEvent)
        if k8serrors.IsNotFound(errOrigin) && ev.Type != types.EventDelete {
@@ -219,8 +226,6 @@ func (c *apisixGlobalRuleController) handleSyncErr(obj 
interface{}, errOrigin er
                                        )
                                }
                        }
-                       c.workqueue.Forget(obj)
-                       c.MetricsCollector.IncrSyncOperation("GlobalRule", 
"success")
                        return
                }
                log.Warnw("sync ApisixGlobalRule failed, will retry",
@@ -241,8 +246,6 @@ func (c *apisixGlobalRuleController) handleSyncErr(obj 
interface{}, errOrigin er
                        )
                }
        }
-       c.workqueue.AddRateLimited(obj)
-       c.MetricsCollector.IncrSyncOperation("GlobalRule", "failure")
 }
 
 func (c *apisixGlobalRuleController) onAdd(obj interface{}) {

Reply via email to