Deadlock/hang

Using 0.19.4, I have rather innocuous client code that issues a synchronous
get:

GetRequestBuilder get = elasticSearchClient.prepareGet(index, "entity", id);
GetResponse result = get.execute().actionGet();

Yet this actionGet() hangs every time.

jstack shows the callstack is hung:

"New I/O worker #4" daemon prio=5 tid=7f9e5412e000 nid=0x112e30000 waiting
on condition [112e2e000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)

  • parking to wait for <7d9a724c8> (a
    org.elasticsearch.common.util.concurrent.BaseFuture$Sync)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
    at
    java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
    at
    java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:969)
    at
    java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1281)
    at
    org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:271)
    at
    org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:113)
    at
    org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:45)

I am issuing this get within another elasticsearch callback.

Is this a defect in elasticsearch, or there some rules I should be playing
by when doing both async and sync calls via the Java client?

Is it something that you can easily recreate? If so, can you gist the code
that recreates it? On the call that ends up calling the callback that
executes this get, can you set the listenerThreaded on it to true and check?

On Sat, May 26, 2012 at 2:06 AM, aaron atdixon@gmail.com wrote:

Using 0.19.4, I have rather innocuous client code that issues a
synchronous get:

GetRequestBuilder get = elasticSearchClient.prepareGet(index, "entity",
id);
GetResponse result = get.execute().actionGet();

Yet this actionGet() hangs every time.

jstack shows the callstack is hung:

"New I/O worker #4" daemon prio=5 tid=7f9e5412e000 nid=0x112e30000
waiting on condition [112e2e000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)

  • parking to wait for <7d9a724c8> (a
    org.elasticsearch.common.util.concurrent.BaseFuture$Sync)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
    at
    java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
    at
    java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:969)
    at
    java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1281)
    at
    org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:271)
    at
    org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:113)
    at
    org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:45)

I am issuing this get within another elasticsearch callback.

Is this a defect in elasticsearch, or there some rules I should be playing
by when doing both async and sync calls via the Java client?

"DubboServerHandler-thread-190" daemon prio=10 tid=0x00002aaad0a2e800 nid=0x5026 waiting on condition [0x00000000470de000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x000000046ad93dd0> (a org.elasticsearch.common.util.concurrent.BaseFuture$Sync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:969)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1281)
at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:271)
at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:113)
at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:45)

Problem is reproduced in elasticsearch 0.19.9

I am facing the issue now. It shows this thread stack for all the threads I have in tomcat server.

"admin-http-pool83" #2807 daemon prio=5 os_prio=0 tid=0x00007f30c801c800 nid=0x1baf waiting on condition [0x00007f2fdad5f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000772711408> (a org.elasticsearch.common.util.concurrent.BaseFuture$Sync)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
        at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:278)
        at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:117)
        at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:44)

Additionally, I have this error on console:
***EST [ERROR][est_client_connect:2217]--> Unable to connect to EST server at address 127.0.0.1

What is the recommended solution here ?