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

Remove manual logstash process management #2

Closed

Conversation

tadeboro
Copy link
Contributor

Logstash process management has been delegated to system's init system and manually killing them is not an option anymore, since this can create some really nasty race conditions. This pull requests removes offending code and redirects all of the process management to init helpers.

Note that because of this change, dmon now needs to run as root user. It would be better to have dmon call sudo for any operations that need elevated privileges, but this change would affect large parts of the DMon's code, so it was not done in this pull request,

@igabriel85
Copy link
Member

We already have init suport for logstash and elasticsearch since the last version.

We use v2 resources for this the v1 have been deprecated since version 0.2.3.

POST /dmon/v2/overlord/core/es
POST /dmon/v2/overlord/core/ls

The init scripts used can be found here.

@igabriel85
Copy link
Member

I should also mention that under heavy load issuing restart or stop to logstash is not deterministic and calling kill -9 is the only way to effectively stop it.

@tadeboro tadeboro force-pushed the fix/remove-logstash-kill branch 3 times, most recently from aaff7ce to 871b823 Compare March 15, 2017 08:53
@tadeboro tadeboro force-pushed the fix/remove-logstash-kill branch 2 times, most recently from ccf1051 to 99f709a Compare March 24, 2017 07:39
Logstash process is managed by system service, which makes it
dangerous to call kill -9 on it manually. Instead of manual
intervention, we let the system tools take care of the process
management.

Manually killing the logstash process was required since SystemV init
scripts cannot handle processes that do not terminate voluntarily. By
using upstart to manage the logstash process, we bypass this problem
completely, since any process that does not terminate voluntarily
withing five seconds is sent SIGKILL that forcefully terminates it.
@tadeboro
Copy link
Contributor Author

Updated patch now allows controlling the logstash heap size environment variable. This makes it possible to set the heap size at runtime.

As for logstash not terminating voluntarily, this is a non-issue with newer init systems, since they forcefully terminate the process after some grace period. In case of upstart that we are using, process is killed after 5 seconds.

@tadeboro tadeboro closed this Oct 4, 2017
@tadeboro tadeboro deleted the fix/remove-logstash-kill branch October 4, 2017 05:41
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