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
Do not kill process on service shutdown #12298
Conversation
@costin the Windows service manager accepts a |
From the (commons-daemon docs]( --StopTimeoutNo TimeoutDefines the timeout in seconds that procrun waits On Thu, Jul 16, 2015 at 10:48 PM, Tanguy Leroux notifications@github.com
|
@costin I supposed - wrongly - that Thanks for your quick response. |
1e12523
to
2f1ca0f
Compare
@@ -14,3 +14,6 @@ packaging.type=rpm | |||
# Custom header for package scripts | |||
packaging.scripts.header= | |||
packaging.scripts.footer=# Built for ${project.name}-${project.version} (${packaging.type}) | |||
|
|||
# Maximum time to wait for elasticsearch to stop (default to 1 day) | |||
packaging.elasticsearch.stopping.timeout=86400 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Complains about no newline at end of file.
So I'm right there with you that kill -9 is going to cause trouble. But maybe we should have some more documentation on what to do if the process doesn't die? When you hit a bug that eats all the memory nothing is going to stop elasticsearch but kill -9. Maybe a |
This is a partial backport of elastic#12298. This fixes an issue that rpms could not be upgraded, because of a bad number check in the postrm script, which exits with a failure. Closes elastic#12606 Closes elastic#12630
I'm OK with this going in without a force option. What does any sysadmin do if any process won't stop? They kill -9 it. I don't think we need to document everything here. I'd rather get the fix in. |
2f1ca0f
to
0f99b18
Compare
@nik9000 I tend to agree with @clintongormley on this. I rebased the code, can I push this? |
Sure
|
When installed as a service with a DEB or RPM package, we should gently wait for elasticsearch to stop (flushing indices on closing can take some time) and never kill the process. Closes elastic#11248
0f99b18
to
b1fd0a6
Compare
@nik9000 thanks! |
I had a problem with this setting blocking a server shutdown. Maybe change this to 10 minutes or so ? (NB: the problem was coming from a snapshot directory on an unavailable NAS) |
We can't do that: the scripts must wait for Elasticsearch to stop nicely and it can sometimes takes more than 10 min. The good thing is that it let you the time to investigate the issue and take the appropriate action (here, kill the node manually?). Doing this automatically in the scripts would have obfuscate the underlying issue. Also, if you have logs and a reproducing scenario it might worth it to create a new issue for the snapshot vs unavailable NAS. |
The problem is that it will prevent the shutdown, but I can't investigate anything as sshd is stopped and even I can't have a console (ttys are already closed). |
When installed as a service with a DEB or RPM package, we should gently wait for elasticsearch to stop (flushing indices on closing can take some time) and never kill the process.
Closes #11248