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

Clean shutdown of influxd server #3334

Merged
merged 1 commit into from
Jul 16, 2015
Merged

Conversation

mcastilho
Copy link
Contributor

There was not a clean shutdown path for influxd run command. The startProfiler() method was listening to signals but was forcing an os.Exit().

With this PR, I am implementing signal trapping and allowing opportunity for server to clean shutdown, sending Close() calls to the Server object appropriately.

Upon first signal, a timeout of 30 seconds is started, and if the clean shutdown hasn't been clompleted yet, a hard shutdown is initialized.

@otoolep
Copy link
Contributor

otoolep commented Jul 15, 2015

Thanks @mcastilho -- have you signed the CLA?

@mcastilho
Copy link
Contributor Author

Yes. I did @otoolep

@otoolep
Copy link
Contributor

otoolep commented Jul 15, 2015

Great, thanks @mcastilho -- I tested your patch, works well.

@otoolep
Copy link
Contributor

otoolep commented Jul 15, 2015

Looks good to me.

@dgnorton ?

@otoolep
Copy link
Contributor

otoolep commented Jul 15, 2015

[run] 2015/07/15 10:31:00 signal received, initializing clean shutdown...
[run] 2015/07/15 10:31:00 waiting for clean shutdown...
[snapshot] 2015/07/15 10:31:00 snapshot listener closed
[tcp] 2015/07/15 10:31:00 cluster service accept error: network connection closed
[shard-precreation] 2015/07/15 10:31:00 precreation service terminating
[retention] 2015/07/15 10:31:00 retention policy enforcement terminating
[retention] 2015/07/15 10:31:00 retention policy enforcement terminating
[run] 2015/07/15 10:31:00 server shutdown completed

@corylanou
Copy link
Contributor

+1

@dgnorton
Copy link
Contributor

+1 Thanks @mcastilho!

otoolep added a commit that referenced this pull request Jul 16, 2015
Clean shutdown of influxd server
@otoolep otoolep merged commit bd2f475 into influxdata:master Jul 16, 2015
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

Successfully merging this pull request may close these issues.

None yet

4 participants