Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Wait for shutdown before returning from main() #1789

Merged
merged 1 commit into from
Mar 4, 2019
Merged

Conversation

bboreham
Copy link
Contributor

@bboreham bboreham commented Mar 4, 2019

Fixes #1788

Currently, memcachedClient.Stop() is getting called at the beginning of the run, on return from main(), which breaks things if the cache moves address.

Personally I find this style too confusing and would just wait at the end of main(), but this looks like a trivial fix.

@squaremo
Copy link
Member

squaremo commented Mar 4, 2019

In the Helm operator main.go, I recanted this defer thing and just moved the blocking code to the end of the procedure. I'd be happy with that here as well.

This is more idiomatic Go and less likely to lead to subtle bugs.
@bboreham bboreham changed the title Move "shutdown protocol" after other uses of 'defer' Wait for shutdown before returning from main() Mar 4, 2019
@bboreham
Copy link
Contributor Author

bboreham commented Mar 4, 2019

I updated my PR to just wait at the end of main().

Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, thanks for updating this Bryan 🍍

@squaremo squaremo merged commit 44874ea into master Mar 4, 2019
@squaremo squaremo deleted the dont-stop-dnsing branch March 4, 2019 14:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not re-querying DNS
3 participants