mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
Merge pull request #91561 from RainbowMango/pr_fix_invalid_recover
fix a client-go crash handler not working issue.
This commit is contained in:
commit
99df02cd4a
@ -195,10 +195,11 @@ type LeaderElector struct {
|
|||||||
|
|
||||||
// Run starts the leader election loop
|
// Run starts the leader election loop
|
||||||
func (le *LeaderElector) Run(ctx context.Context) {
|
func (le *LeaderElector) Run(ctx context.Context) {
|
||||||
|
defer runtime.HandleCrash()
|
||||||
defer func() {
|
defer func() {
|
||||||
runtime.HandleCrash()
|
|
||||||
le.config.Callbacks.OnStoppedLeading()
|
le.config.Callbacks.OnStoppedLeading()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if !le.acquire(ctx) {
|
if !le.acquire(ctx) {
|
||||||
return // ctx signalled done
|
return // ctx signalled done
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user