Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When stopping via systemd only kill the JVM, not its control group
Browse files Browse the repository at this point in the history
This prevents possible race conditions between the Elasticsearch JVM and
plugin native controller processes that can cause the Elasticsearch shutdown
to hang.  The problem can happen when the JVM and the controller process
receive a SIGTERM at almost the same time.

(There's an assumption here that Elasticsearch will continue to use other
mechanisms to kill native controller processes.)
droberts195 committed Jun 14, 2017
1 parent 1c95cbc commit 5cbd6da
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions distribution/src/main/packaging/systemd/elasticsearch.service
Original file line number Diff line number Diff line change
@@ -52,6 +52,9 @@ TimeoutStopSec=0
# SIGTERM signal is used to stop the Java process
KillSignal=SIGTERM

# Send the signal only to the JVM rather than its control group
KillMode=process

# Java process is never killed
SendSIGKILL=no

0 comments on commit 5cbd6da

Please sign in to comment.