# App hangs (with es blocking requests)

**URL:** <https://discuss.elastic.co/t/app-hangs-with-es-blocking-requests/13864>\
**Category:** Elasticsearch\
**Created:** [October 7, 2013, 12:02pm UTC](https://discuss.elastic.co/t/app-hangs-with-es-blocking-requests/13864 "2013-10-07T12:02:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolas\_long](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@nicolas\_long](https://discuss.elastic.co/u/nicolas_long)\
**Post date:** [October 7, 2013, 12:02pm UTC](https://discuss.elastic.co/t/app-hangs-with-es-blocking-requests/13864/1 "2013-10-07T12:02:42Z")

</div>

Hi all,

I've been experiencing a bug where my application hangs. I haven't been  
able to work out the problem and the code looks okay. Inspecting the  
threads I see several are blocked with the following:

- sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information  
may be imprecise)
- java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object, long)  
@bci=20, line=226 (Compiled frame)
- 

## org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.awaitMatch(org.elasticsearch.common.util.concurrent.jsr166y.LinkedTra nsferQueue$Node, org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue$Node, java.lang.Object, boolean, long) @bci=180, line=7 02 (Compiled frame)

## org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.xfer(java.lang.Object, boolean, int, long) @bci=286, line=615 (Compil ed frame)

org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.poll(long,  
java.util.concurrent.TimeUnit) @bci=9, line=1117 (Compiled  
frame)

- java.util.concurrent.ThreadPoolExecutor.getTask() @bci=141, line=1068  
(Compiled frame)
- 

java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker)  
@bci=26, line=1130 (Compiled frame)

- java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=615  
(Interpreted frame)
- java.lang.Thread.run() @bci=11, line=724 (Interpreted frame)

Anyone know whether this is normal?

Thanks,

Nic

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 7, 2013, 4:11pm UTC](https://discuss.elastic.co/t/app-hangs-with-es-blocking-requests/13864/2 "2013-10-07T16:11:50Z")

</div>

Are you sure these threads are blocked?

From my understanding, this is just a thread in an ES scaling queue waiting  
for a job.

You might want to play with thread pool settings to find out more about ES  
threads waiting for jobs:  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-threadpool.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-threadpool.html)

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![nicolas\_long](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@nicolas\_long](https://discuss.elastic.co/u/nicolas_long)\
**Post date:** [October 8, 2013, 11:43am UTC](https://discuss.elastic.co/t/app-hangs-with-es-blocking-requests/13864/3 "2013-10-08T11:43:15Z")

</div>

Hi Jörg,

thanks for the reply. They appear as blocked when using jstack, but I don't  
know if that is normal or not. Certainly, my application hangs without  
throwing an exception. And the code itself makes a (blocking) serch request  
to ES (using the java-library). It looks like this:

```
val search = 

```

client.prepareSearch(indexName).setFilter(idsFilter(takedownTypes:  
\_\*).addIds(id))  
val searchResponse = search.execute().actionGet(2000)

I can't see anything obviously wrong with this, but perhaps I'm missing  
something? Or it might be a problem elsewhere of course (although I've  
tried my best to eliminate that possibility).

On Monday, 7 October 2013 13:02:42 UTC+1, [nicola...@guardian.co.uk](mailto:nicola...@guardian.co.uk) wrote:

> Hi all,
> 
> I've been experiencing a bug where my application hangs. I haven't been  
> able to work out the problem and the code looks okay. Inspecting the  
> threads I see several are blocked with the following:
> 
> - sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information  
> may be imprecise)
> - java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object,  
> long) @bci=20, line=226 (Compiled frame)
> - 
> 
> ## org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.awaitMatch(org.elasticsearch.common.util.concurrent.jsr166y.LinkedTra nsferQueue$Node, org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue$Node, java.lang.Object, boolean, long) @bci=180, line=7 02 (Compiled frame)
> 
> ## org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.xfer(java.lang.Object, boolean, int, long) @bci=286, line=615 (Compil ed frame)
> 
> org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.poll(long,  
> java.util.concurrent.TimeUnit) @bci=9, line=1117 (Compiled  
> frame)
> 
> - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=141, line=1068  
> (Compiled frame)
> - 
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker)  
> @bci=26, line=1130 (Compiled frame)
> 
> - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=615  
> (Interpreted frame)
> - java.lang.Thread.run() @bci=11, line=724 (Interpreted frame)
> 
> Anyone know whether this is normal?
> 
> Thanks,
> 
> Nic

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 8, 2013, 1:27pm UTC](https://discuss.elastic.co/t/app-hangs-with-es-blocking-requests/13864/4 "2013-10-08T13:27:03Z")

</div>

Maybe it helps if you can post/gist the complete thread dump somewhere so  
we can look at it?

Jörg  
Am 08.10.2013 13:43 schrieb [nicolas.long@guardian.co.uk](mailto:nicolas.long@guardian.co.uk):

> Hi Jörg,
> 
> thanks for the reply. They appear as blocked when using jstack, but I  
> don't know if that is normal or not. Certainly, my application hangs  
> without throwing an exception. And the code itself makes a (blocking) serch  
> request to ES (using the java-library). It looks like this:
> 
> ```
> val search =
> 
> ```
> 
> client.prepareSearch(indexName).setFilter(idsFilter(takedownTypes:  
> \_\*).addIds(id))  
> val searchResponse = search.execute().actionGet(2000)
> 
> I can't see anything obviously wrong with this, but perhaps I'm missing  
> something? Or it might be a problem elsewhere of course (although I've  
> tried my best to eliminate that possibility).
> 
> On Monday, 7 October 2013 13:02:42 UTC+1, [nicola...@guardian.co.uk](mailto:nicola...@guardian.co.uk) wrote:
> 
> > Hi all,
> > 
> > I've been experiencing a bug where my application hangs. I haven't been  
> > able to work out the problem and the code looks okay. Inspecting the  
> > threads I see several are blocked with the following:
> > 
> > - sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information  
> > may be imprecise)
> > - java.util.concurrent.locks.\*\*LockSupport.parkNanos(java.\*\*lang.Object,  
> > long) @bci=20, line=226 (Compiled frame)
> > - org.elasticsearch.common.util. **concurrent.jsr166y.**  
> > LinkedTransferQueue.**awaitMatch(org.elasticsearch.**  
> > common.util.concurrent.\*\*jsr166y.LinkedTra  
> > nsferQueue$Node, org.elasticsearch.common.util.\*\*concurrent.jsr166y.\*\*LinkedTransferQueue$Node,  
> > java.lang.Object, boolean, long) @bci=180, line=7  
> > 02 (Compiled frame)
> > - org.elasticsearch.common.util. **concurrent.jsr166y.**  
> > LinkedTransferQueue.xfer(java.\*\*lang.Object, boolean, int, long)  
> > @bci=286, line=615 (Compil  
> > ed frame)
> > - org.elasticsearch.common.util.\*\*concurrent.jsr166y.\*\*LinkedTransferQueue.poll(long,  
> > java.util.concurrent.TimeUnit) @bci=9, line=1117 (Compiled  
> > frame)
> > - java.util.concurrent.\*\*ThreadPoolExecutor.getTask() @bci=141,  
> > line=1068 (Compiled frame)
> > - java.util.concurrent.**ThreadPoolExecutor.runWorker(**  
> > java.util.concurrent.\*\*ThreadPoolExecutor$Worker) @bci=26, line=1130  
> > (Compiled frame)
> > - java.util.concurrent.**ThreadPoolExecutor$Worker.run(**) @bci=5,  
> > line=615 (Interpreted frame)
> > - java.lang.Thread.run() @bci=11, line=724 (Interpreted frame)
> > 
> > Anyone know whether this is normal?
> > 
> > Thanks,
> > 
> > Nic
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Boaz\_Leskes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boaz_leskes/32/723_2.png) [@Boaz\_Leskes](https://discuss.elastic.co/u/Boaz_Leskes)\
**Post date:** [October 8, 2013, 1:33pm UTC](https://discuss.elastic.co/t/app-hangs-with-es-blocking-requests/13864/5 "2013-10-08T13:33:35Z")

</div>

Hi Nicola,

This is normal. There are lot of thread pools in Elasticsearch and this one  
is just waiting for something to do.

Can perhaps post a complete stack dump of all threads?

Also - do other search request hang as well or just this one?

Cheers,  
Boaz

On Monday, October 7, 2013 2:02:42 PM UTC+2, [nicola...@guardian.co.uk](mailto:nicola...@guardian.co.uk) wrote:

> Hi all,
> 
> I've been experiencing a bug where my application hangs. I haven't been  
> able to work out the problem and the code looks okay. Inspecting the  
> threads I see several are blocked with the following:
> 
> - sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information  
> may be imprecise)
> - java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object,  
> long) @bci=20, line=226 (Compiled frame)
> - 
> 
> ## org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.awaitMatch(org.elasticsearch.common.util.concurrent.jsr166y.LinkedTra nsferQueue$Node, org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue$Node, java.lang.Object, boolean, long) @bci=180, line=7 02 (Compiled frame)
> 
> ## org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.xfer(java.lang.Object, boolean, int, long) @bci=286, line=615 (Compil ed frame)
> 
> org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.poll(long,  
> java.util.concurrent.TimeUnit) @bci=9, line=1117 (Compiled  
> frame)
> 
> - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=141, line=1068  
> (Compiled frame)
> - 
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker)  
> @bci=26, line=1130 (Compiled frame)
> 
> - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=615  
> (Interpreted frame)
> - java.lang.Thread.run() @bci=11, line=724 (Interpreted frame)
> 
> Anyone know whether this is normal?
> 
> Thanks,
> 
> Nic

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:13am UTC](https://discuss.elastic.co/t/app-hangs-with-es-blocking-requests/13864/6 "2017-07-06T02:13:22Z")

</div>


