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

Detach Elasticsearch on startup #859

Merged

Conversation

danielmitterdorfer
Copy link
Member

With this commit we detach Elasticsearch on startup from its controlling
process via the setpgrp system call. Although we start Elasticsearch
with the -d flag, this is necessary to ensure it does not receive signals
like SIGHUP from its original parent process (Rally).

With this commit we detach Elasticsearch on startup from its controlling
process via the
[setpgrp](http://man7.org/linux/man-pages/man3/setpgrp.3p.html) system
call. Although we start Elasticsearch with the `-d` flag, this is
necessary to ensure it does not receive signals like `SIGHUP` from its
original parent process (Rally).
@danielmitterdorfer danielmitterdorfer added bug Something's wrong :Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch labels Jan 10, 2020
@danielmitterdorfer danielmitterdorfer added this to the 1.4.0 milestone Jan 10, 2020
@danielmitterdorfer danielmitterdorfer self-assigned this Jan 10, 2020
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@danielmitterdorfer danielmitterdorfer merged commit bebf9a0 into elastic:master Jan 13, 2020
@danielmitterdorfer danielmitterdorfer deleted the detach-on-start branch January 13, 2020 06:35
danielmitterdorfer added a commit to danielmitterdorfer/rally that referenced this pull request Jan 29, 2020
With this commit we use the parameter `start_new_session` to detach
Elasticsearch from its parent process group (Rally) instead of the
problematic (and low-level) `preexec_fn`. Under the hood this will use
the `setsid` system call instead of `setpgrp`.

See also:

* https://linux.die.net/man/2/setsid
* https://linux.die.net/man/2/setpgrp

Relates elastic#859
danielmitterdorfer added a commit that referenced this pull request Jan 30, 2020
With this commit we use the parameter `start_new_session` to detach
Elasticsearch from its parent process group (Rally) instead of the
problematic (and low-level) `preexec_fn`. Under the hood this will use
the `setsid` system call instead of `setpgrp`.

See also:

* https://linux.die.net/man/2/setsid
* https://linux.die.net/man/2/setpgrp

Relates #859
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch bug Something's wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants