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

Wait for shutdown before returning from main() #1789

Merged
merged 1 commit into from Mar 4, 2019

Conversation

Projects
None yet
3 participants
@bboreham
Copy link
Member

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

This comment has been minimized.

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.

Wait for shutdown before returning from main()
This is more idiomatic Go and less likely to lead to subtle bugs.

@bboreham bboreham force-pushed the dont-stop-dnsing branch from cf9102e to f0ab7f1 Mar 4, 2019

@bboreham bboreham changed the title Move "shutdown protocol" after other uses of 'defer' Wait for shutdown before returning from main() Mar 4, 2019

@bboreham

This comment has been minimized.

Copy link
Member Author

bboreham commented Mar 4, 2019

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

@squaremo
Copy link
Member

squaremo left a comment

Nice one, thanks for updating this Bryan 🍍

@squaremo squaremo merged commit 44874ea into master Mar 4, 2019

1 check passed

ci/circleci: build Your tests passed on CircleCI!
Details

@squaremo squaremo deleted the dont-stop-dnsing branch Mar 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.