# EsRejectedExecution Exception

**URL:** <https://discuss.elastic.co/t/esrejectedexecution-exception/56493>\
**Category:** Elasticsearch\
**Created:** [July 27, 2016, 9:31am UTC](https://discuss.elastic.co/t/esrejectedexecution-exception/56493 "2016-07-27T09:31:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [July 27, 2016, 10:44am UTC](https://discuss.elastic.co/t/esrejectedexecution-exception/56493/2 "2016-07-27T10:44:31Z")

</div>

Hi @Sai_Birada,

> With this never bulk indexing queue should fill up more than 50 right?

No. This can still happen. For the reasons see my answer in the topic [Threadpool/ Queue size limitation unsolved](https://discuss.elastic.co/t/threadpool-queue-size-limitation-unsolved/55938). In that response I also suggest concrete mitigation techniques.

With your approach you basically busy wait (`Thread.yield()` is usually implemented a no-op in the JVM and even if it weren't, you wouldn't wait) until the queue is below 40 items. Apart from repeatedly checking the nodes stats (additional effort for ES), you also have a race as two threads can concurrently observe a queue size of less than 40 items and submit a bulk.

Daniel

---

_[View the full topic](https://discuss.elastic.co/t/esrejectedexecution-exception/56493)._
