# Threadpool queue\_size: 0 kills JVM

**URL:** <https://discuss.elastic.co/t/threadpool-queue-size-0-kills-jvm/8221>\
**Category:** Elasticsearch\
**Created:** [June 25, 2012, 10:23pm UTC](https://discuss.elastic.co/t/threadpool-queue-size-0-kills-jvm/8221 "2012-06-25T22:23:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [June 25, 2012, 10:23pm UTC](https://discuss.elastic.co/t/threadpool-queue-size-0-kills-jvm/8221/1 "2012-06-25T22:23:23Z")

</div>

Here is something interesting!

Added this to elasticsearch.yml and restarted ES:

threadpool:  
search:  
type: fixed  
size: 120  
queue\_size: 0 \<==== note this  
reject\_policy: abort

Got this in wrapper.log:

INFO | jvm 1 | 2012/06/25 17:48:36 | {0.19.4}: Initialization Failed  
...  
INFO | jvm 1 | 2012/06/25 17:48:36 | 1) IllegalStateException[This is  
a proxy used to support circular references involving constructors. The  
object we're proxying is not constructed yet. Please wait until after  
injection has completed to use this object.]2)  
IllegalArgumentException[null]  
STATUS | wrapper | 2012/06/25 17:48:39 | \<-- Wrapper Stopped

I then changed queue\_size to 1 and the problem disappeared.

ES bug or?

$ java -version  
java version "1.6.0\_29"  
Java(TM) SE Runtime Environment (build 1.6.0\_29-b11)  
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)

## Thanks, Otis

Search Analytics - [http://sematext.com/search-analytics/index.html](http://sematext.com/search-analytics/index.html)  
Scalable Performance Monitoring - [http://sematext.com/spm/index.html](http://sematext.com/spm/index.html)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 26, 2012, 12:02am UTC](https://discuss.elastic.co/t/threadpool-queue-size-0-kills-jvm/8221/2 "2012-06-26T00:02:09Z")

</div>

Yea, 0 is not a valid value for the fixed thread pool, it should be \>0,  
since we create a bounded queue and it has to have at least 1 element to be  
able to "pass" it to the thread pool.

On Tue, Jun 26, 2012 at 12:23 AM, Otis Gospodnetic \<  
[otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:

> Here is something interesting!
> 
> Added this to elasticsearch.yml and restarted ES:
> 
> threadpool:  
> search:  
> type: fixed  
> size: 120  
> queue\_size: 0 \<==== note this  
> reject\_policy: abort
> 
> Got this in wrapper.log:
> 
> INFO | jvm 1 | 2012/06/25 17:48:36 | {0.19.4}: Initialization Failed  
> ...  
> INFO | jvm 1 | 2012/06/25 17:48:36 | 1) IllegalStateException[This is  
> a proxy used to support circular references involving constructors. The  
> object we're proxying is not constructed yet. Please wait until after  
> injection has completed to use this object.]2)  
> IllegalArgumentException[null]  
> STATUS | wrapper | 2012/06/25 17:48:39 | \<-- Wrapper Stopped
> 
> I then changed queue\_size to 1 and the problem disappeared.
> 
> ES bug or?
> 
> $ java -version  
> java version "1.6.0\_29"  
> Java(TM) SE Runtime Environment (build 1.6.0\_29-b11)  
> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)
> 
> ## Thanks, Otis
> 
> Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
> Scalable Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [June 26, 2012, 1:53am UTC](https://discuss.elastic.co/t/threadpool-queue-size-0-kills-jvm/8221/3 "2012-06-26T01:53:36Z")

</div>

Hi Shay,

Yeah, I realized that might be the case after posting, but then, check the  
doc:  
" The queue\_size allows to control the size of the queue of pending  
requests that have no threads to execute them. "

So one can then thing like this:  
"OK, and if I don't want to queue up any pending requests and I just want  
to reject any requests that exceed the number of threads, I'll just set  
queue size to 0".

Shouldn't one be able to do this?

## Otis

Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
Scalable Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)

On Monday, June 25, 2012 8:02:09 PM UTC-4, kimchy wrote:

> Yea, 0 is not a valid value for the fixed thread pool, it should be \>0,  
> since we create a bounded queue and it has to have at least 1 element to be  
> able to "pass" it to the thread pool.
> 
> On Tue, Jun 26, 2012 at 12:23 AM, Otis Gospodnetic \<  
> [otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:
> 
> > Here is something interesting!
> > 
> > Added this to elasticsearch.yml and restarted ES:
> > 
> > threadpool:  
> > search:  
> > type: fixed  
> > size: 120  
> > queue\_size: 0 \<==== note this  
> > reject\_policy: abort
> > 
> > Got this in wrapper.log:
> > 
> > INFO | jvm 1 | 2012/06/25 17:48:36 | {0.19.4}: Initialization Failed  
> > ...  
> > INFO | jvm 1 | 2012/06/25 17:48:36 | 1) IllegalStateException[This  
> > is a proxy used to support circular references involving constructors. The  
> > object we're proxying is not constructed yet. Please wait until after  
> > injection has completed to use this object.]2)  
> > IllegalArgumentException[null]  
> > STATUS | wrapper | 2012/06/25 17:48:39 | \<-- Wrapper Stopped
> > 
> > I then changed queue\_size to 1 and the problem disappeared.
> > 
> > ES bug or?
> > 
> > $ java -version  
> > java version "1.6.0\_29"  
> > Java(TM) SE Runtime Environment (build 1.6.0\_29-b11)  
> > Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)
> > 
> > ## Thanks, Otis
> > 
> > Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
> > Scalable Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 26, 2012, 12:25pm UTC](https://discuss.elastic.co/t/threadpool-queue-size-0-kills-jvm/8221/4 "2012-06-26T12:25:03Z")

</div>

Yea, he should, Igor sent a pull request allowing to use 0, it will be part  
of 0.19.7.

On Tue, Jun 26, 2012 at 3:53 AM, Otis Gospodnetic \<  
[otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:

> Hi Shay,
> 
> Yeah, I realized that might be the case after posting, but then, check the  
> doc:  
> " The queue\_size allows to control the size of the queue of pending  
> requests that have no threads to execute them. "
> 
> So one can then thing like this:  
> "OK, and if I don't want to queue up any pending requests and I just want  
> to reject any requests that exceed the number of threads, I'll just set  
> queue size to 0".
> 
> Shouldn't one be able to do this?
> 
> ## Otis
> 
> Search Analytics - [http://sematext.com/search-\*\*analytics/index.html](http://sematext.com/search-**analytics/index.html)[http://sematext.com/search-analytics/index.html](http://sematext.com/search-analytics/index.html)  
> Scalable Performance Monitoring - [http://sematext.com/spm/index.\*\*html](http://sematext.com/spm/index.**html)[http://sematext.com/spm/index.html](http://sematext.com/spm/index.html)
> 
> On Monday, June 25, 2012 8:02:09 PM UTC-4, kimchy wrote:
> 
> > Yea, 0 is not a valid value for the fixed thread pool, it should be \>0,  
> > since we create a bounded queue and it has to have at least 1 element to be  
> > able to "pass" it to the thread pool.
> > 
> > On Tue, Jun 26, 2012 at 12:23 AM, Otis Gospodnetic \<  
> > [otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:
> > 
> > > Here is something interesting!
> > > 
> > > Added this to elasticsearch.yml and restarted ES:
> > > 
> > > threadpool:  
> > > search:  
> > > type: fixed  
> > > size: 120  
> > > queue\_size: 0 \<==== note this  
> > > reject\_policy: abort
> > > 
> > > Got this in wrapper.log:
> > > 
> > > INFO | jvm 1 | 2012/06/25 17:48:36 | {0.19.4}: Initialization  
> > > Failed ...  
> > > INFO | jvm 1 | 2012/06/25 17:48:36 | 1) IllegalStateException[This  
> > > is a proxy used to support circular references involving constructors. The  
> > > object we're proxying is not constructed yet. Please wait until after  
> > > injection has completed to use this object.]2)  
> > > IllegalArgumentException[null]  
> > > STATUS | wrapper | 2012/06/25 17:48:39 | \<-- Wrapper Stopped
> > > 
> > > I then changed queue\_size to 1 and the problem disappeared.
> > > 
> > > ES bug or?
> > > 
> > > $ java -version  
> > > java version "1.6.0\_29"  
> > > Java(TM) SE Runtime Environment (build 1.6.0\_29-b11)  
> > > Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)
> > > 
> > > ## Thanks, Otis
> > > 
> > > Search Analytics - [http://sematext.com/search-\*\*analytics/index.html](http://sematext.com/search-**analytics/index.html)[http://sematext.com/search-analytics/index.html](http://sematext.com/search-analytics/index.html)  
> > > Scalable Performance Monitoring - [http://sematext.com/spm/index.\*\*html](http://sematext.com/spm/index.**html)[http://sematext.com/spm/index.html](http://sematext.com/spm/index.html)

---

<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:** [July 6, 2017, 3:22am UTC](https://discuss.elastic.co/t/threadpool-queue-size-0-kills-jvm/8221/5 "2017-07-06T03:22:29Z")

</div>


