Skip to content

Commit e67023d

Browse files
author
David Roberts
committed
When stopping via systemd only kill the JVM, not its control group (#25195)
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.)
1 parent 84428da commit e67023d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

distribution/src/main/packaging/systemd/elasticsearch.service

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ TimeoutStopSec=0
5252
# SIGTERM signal is used to stop the Java process
5353
KillSignal=SIGTERM
5454

55+
# Send the signal only to the JVM rather than its control group
56+
KillMode=process
57+
5558
# Java process is never killed
5659
SendSIGKILL=no
5760

0 commit comments

Comments
 (0)