-
Notifications
You must be signed in to change notification settings - Fork 19
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 daemons & http shutdown #63
Merged
ddurieux
merged 12 commits into
Alignak-monitoring:develop
from
gst:clean_daemons_shutdown
Jun 9, 2015
Merged
Clean daemons & http shutdown #63
ddurieux
merged 12 commits into
Alignak-monitoring:develop
from
gst:clean_daemons_shutdown
Jun 9, 2015
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gst
force-pushed
the
clean_daemons_shutdown
branch
from
June 9, 2015 13:27
3a3c1e4
to
ca83136
Compare
don't merge directly... have to verify some thing.. |
do_stop() does join() on the http thread..
and apparently generated some trouble from time to time (race condition). and don't import * but just what's used.
so that if creating the server fails then the lock is available.
+ renamed shutdown() to close_sockets() + better logs + don't use the lock to start&stop the main http thread (don't know the reason of this, doesn't seem necessary to me) + no need to inspect for the manager.start() special case in py26 ..
because we do kill the proc pid at the end.
wait_for_initial_conf() is "buggy" since we moved from Pyro to http for communication, because handleRequest() -> get_socks_activity() calls select() with empty sock set, resulting in a sleep() behavior.
Given requests coming from clients should come directly once the connection is established, use an hardcoded timeout for the client socket. 10 secs is rather conservative actually, should be safe. A more agressive timeout (like 5 secs) could also be safely used. This prevents bad clients from blocking http threads.
gst
force-pushed
the
clean_daemons_shutdown
branch
from
June 9, 2015 16:13
ca83136
to
34b0945
Compare
ok that's a first quick clean / fix ; I think it's preferable to merge it as it.. There will be anyway others passes and (big) clean/changes/rewrite on the http_daemon module so let's go.. |
ddurieux
pushed a commit
that referenced
this pull request
Jun 9, 2015
Clean daemons & http shutdown
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Basically: join the main http thread (and in it join all the http client threads) when stopping an alignak daemon, so that no http thread is left running while everything is closed (which can, and have already, be harmful) .
+ some cleaning