Skip to content
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

What else to do when a context is cancelled? #3

Open
shreemaan-abhishek opened this issue Nov 6, 2022 · 1 comment
Open

What else to do when a context is cancelled? #3

shreemaan-abhishek opened this issue Nov 6, 2022 · 1 comment

Comments

@shreemaan-abhishek
Copy link
Owner

shreemaan-abhishek commented Nov 6, 2022

Currently, we just close the etcd client by calling client.Close() this revokes the lease which means that the current instance is no longer participating in the leader election. If there are other instances/replicas of this program/process, they can proceed to take ownership of the lease under the given prefix to claim leadership.

Calling cli.Close() causes the process to busy-wait. (fancy word for doing nothing). I noticed this when I used Rasputin in a simple command line app. Not sure if busy-waiting can be harmful when Rasputin is used in kubernetes microservices. Just creating this issue to document this thought.

@shreemaan-abhishek
Copy link
Owner Author

shreemaan-abhishek commented Nov 6, 2022

Another thing:

On this line, if we use log.Fatal() instead of log.Println() (or other similar logging methods) the process ends. (Again, this was noticed when using Rasputin in a command line app)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant