tokers commented on a change in pull request #453:
URL:
https://github.com/apache/apisix-ingress-controller/pull/453#discussion_r634951844
##########
File path: pkg/ingress/controller.go
##########
@@ -317,30 +325,47 @@ election:
}
func (c *Controller) run(ctx context.Context) {
- log.Infow("controller now is running as leader",
+ log.Infow("controller tries to leading ...",
zap.String("namespace", c.namespace),
zap.String("pod", c.name),
)
+
+ var cancelFunc context.CancelFunc
Review comment:
The reason why I introduced the `leaderContextCancelFunc` is, package
`leaderelection` doesn't quit the lease renew loop even if `c.run` exits.
> Not, you mean use one c.leaderContextCancelFunc to control the run context
? It is not enough.
I think the code should wait for all goroutine to exit in c.run before
executing the next election.
Yep, waiting is required before it exits. This is logical inside `c.run`.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]