Hi all,
I was reading https://github.com/elastic/elasticsearch/issues/7838 and saw that it was suggested to use "kill -9 %p" when elasticsearch runs out of memory. This sounds like an ok solution (assuming there is enough memory available to spawn a child process). But kill never seems to run, no matter where I put the -XX:OnOutOfMemoryError flag.
The problem seem to come down to the main elasticsearch script file (/bin/elasticsearch) on the line:
exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH"
org.elasticsearch.bootstrap.Elasticsearch start "$@"
If I replace exec with eval it works, but that's not ideal. If nobody has a workaround that doesn't involve hot patching I suggest writing a bug.
Regards
Eoghan