# JVM does not exit

**URL:** <https://discuss.elastic.co/t/jvm-does-not-exit/164077>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [January 14, 2019, 2:57am UTC](https://discuss.elastic.co/t/jvm-does-not-exit/164077 "2019-01-14T02:57:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanbj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanbj/32/24677_2.png) [@hanbj](https://discuss.elastic.co/u/hanbj)\
**Post date:** [January 14, 2019, 2:57am UTC](https://discuss.elastic.co/t/jvm-does-not-exit/164077/1 "2019-01-14T02:57:24Z")

</div>

Hello, everyone. This cluster has been running for a long time. Today pending tasks pile up too many tasks. Check the master log and find the following warn message. The master waits for the response of the bdes225 node after sending ClusterState. Until the master waits for the timeout.

version: elasticsearch-5.4.2

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/b/6bad4cc4d89408ef1b918fc9cb118db95ddcb317.png)

I checked the log of bdes225 and found the following errors.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/3/03e2f121780ad65ba6fdd7dc5b1e546753858afb.png)

I have a doubt that I have not solved.  
1、fatal error in thread [elasticsearch[bdes225-prd1][clusterService#updateTask][T#5]], exiting

After the log is printed, the Elastic search UncaughtExceptionHandler:: halt method is executed, but the JVM does not exit.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [January 16, 2019, 12:16pm UTC](https://discuss.elastic.co/t/jvm-does-not-exit/164077/2 "2019-01-16T12:16:26Z")

</div>

Is this stock Elasticsearch or have you modified it?

---

<div class="post-metadata">

**Author:** ![hanbj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanbj/32/24677_2.png) [@hanbj](https://discuss.elastic.co/u/hanbj)\
**Post date:** [January 16, 2019, 1:29pm UTC](https://discuss.elastic.co/t/jvm-does-not-exit/164077/3 "2019-01-16T13:29:41Z")

</div>

Thanks, I've found the cause of the problem. But in this case, the thread will go down or the JVM will exit.  
These errors were reported for several hours and the pending tasks piled up tens of thousands, seriously affecting the production environment.  
I don't think it should affect the whole cluster, so I mentioned a PR.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [January 16, 2019, 1:45pm UTC](https://discuss.elastic.co/t/jvm-does-not-exit/164077/4 "2019-01-16T13:45:42Z")

</div>

What was the issue?

---

<div class="post-metadata">

**Author:** ![hanbj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanbj/32/24677_2.png) [@hanbj](https://discuss.elastic.co/u/hanbj)\
**Post date:** [January 16, 2019, 2:07pm UTC](https://discuss.elastic.co/t/jvm-does-not-exit/164077/5 "2019-01-16T14:07:56Z")

</div>

Our cluster metadata operation is particularly frequent. The operation of metadata is single-thread serial execution and finally passes the allocation module. I optimized the logic of this part, modified the source code and compiled it.  
The reason for the problem is that I replaced the original jar, but for special reasons this node process did not restart, I reproduce this problem in the test environment. Not a normal problem, sorry.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [January 16, 2019, 3:40pm UTC](https://discuss.elastic.co/t/jvm-does-not-exit/164077/6 "2019-01-16T15:40:26Z")

</div>

Right, so as suspected you've modified Elasticsearch and broke it. We can not support that.

The correct behavior for Elasticsearch when something that we can not recover from happens, is for the process to die. That is what the uncaught exception handler does. A `NoClassDefFoundError` is unrecoverable.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 13, 2019, 3:40pm UTC](https://discuss.elastic.co/t/jvm-does-not-exit/164077/7 "2019-02-13T15:40:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
