I searched past issues, but I can't find any reference to this one.
I'm upgrading a 1.4.2 solution to a 2.4.4 (on the way to 5.x).
The offending operation is basically:
QueryBuilder query = ...
Client client = Node.client(); // Same behaviour with transport client
client.prepareSearch("myindex").setVersion(true).setQuery(query).
The exception I'm getting is:
Caused by: java.lang.AssertionError: Expected current thread [Thread[task-scheduler-6,5,main]] to not be the scheduler thread. Reason: [Blocking operation] at org.elasticsearch.threadpool.ThreadPool.assertNotScheduleThread(ThreadPool.java:1089) at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:119) at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:42) at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:64)
I've looked at the ES source and I see that the get operation should, indeed, not be running on a scheduler thread, but I'm unclear why this is happening or how to avoid it.