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

[FIXED] Ensure Shutdown() always stops http server #498

Merged
merged 1 commit into from May 26, 2017

Conversation

kozlovic
Copy link
Member

In case one creates a server instance with New() and then starts
the http server manually (s.StartHTTPMonitoring()), calling
s.Shutdown() would not stop the http server because Shutdown()
would return without doing anything if running was not true.
This boolean was set to true only in s.Start().

Also added StartMonitoring() to perform the options check and
selectively start http or https server to replace individual calls.
This is useful for NATS Streaming server that will now be able
to call s.StartMonitoring() without having to duplicate code
about options checks and http server code.

This is related to PR #481

In case one creates a server instance with New() and then starts
the http server manually (s.StartHTTPMonitoring()), calling
s.Shutdown() would not stop the http server because Shutdown()
would return without doing anything if `running` was not true.
This boolean was set to true only in `s.Start()`.

Also added StartMonitoring() to perform the options check and
selectively start http or https server to replace individual calls.
This is useful for NATS Streaming server that will now be able
to call s.StartMonitoring() without having to duplicate code
about options checks and http server code.

This is related to PR #481
@kozlovic kozlovic changed the title [FIXED] Shutdown stops http server when started manually [FIXED] Ensure Shutdown() always stops http server May 25, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 91.005% when pulling 773b25a on stop_http_server_on_shutdown into 1acdd23 on master.

@derekcollison derekcollison merged commit d606944 into master May 26, 2017
@derekcollison derekcollison deleted the stop_http_server_on_shutdown branch May 26, 2017 00:38
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

3 participants