-
Notifications
You must be signed in to change notification settings - Fork 218
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: leader election stop not called #2059
Conversation
Signed-off-by: Attila Mészáros <csviri@gmail.com>
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/LeaderElectionManager.java
Show resolved
Hide resolved
@@ -67,7 +67,7 @@ private void init(LeaderElectionConfiguration config) { | |||
config.getRenewDeadline(), | |||
config.getRetryPeriod(), | |||
leaderCallbacks(), | |||
true, | |||
false, // this is required to receive stop event in all cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why, though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean? we want to get those all cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean is that the comment doesn't explain why changing the value to false
makes sure that stop
is called…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be part of the fabric8 client docs rather, actually not there but it's in the go docs?
https://pkg.go.dev/k8s.io/client-go/tools/leaderelection#LeaderElectionConfig
Should I link this there you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe but mostly explain why this "release on cancel" setting has an impact on the lifecycle of our manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extended the comment, but basically this should be very straghforward, that the onStop is called, also if the lock is released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/operator-framework/java-operator-sdk/pull/2059/files#diff-e493dfcdf8473a2824e76c20c95f07b6dc94a1305f6816d029b7de8e73a46931R59 should be removed. sorry for seeing this late
ahh, yes: #2066 |
No description provided.