Revolyssup commented on code in PR #2152:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/2152#discussion_r1473980439


##########
pkg/providers/controller.go:
##########
@@ -227,39 +208,30 @@ func (c *Controller) setupLeaderElection() error {
                        },
                        OnStoppedLeading: func() {
                                c.MetricsCollector.ResetLeader(false)
-                               log.Infow("controller now is running as a 
candidate",
+                               log.Infow("controller lost leader, exiting",
                                        zap.String("namespace", c.namespace),
                                        zap.String("pod", c.name),
                                )
+                               // rootCancel might be to slow, and controllers 
may have bugs that cause them to not yield
+                               // the safest way to step down is to simply 
cause a pod restart
+                               os.Exit(0)

Review Comment:
   Makes sense 



-- 
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]

Reply via email to