Client.setTimeout(millis) does not seem to work ( unlike ActionFuture.actionGet(millis) )

Hi, our cluster has been experiencing some query timeouts which we
originally attributed to GC issues. We resolved those but we still have
timeouts.

Question 1: We increased the timeout value in the search builder's action
future. We did this by setting the future task's timeout value as shown
below. Obviously this is the client side setting. We also tried to set the
query side timeout but it does not seem to work.

I've pasted the example unit test code. Is this a known issue or are I
doing something wrong?

Question 2: When a ElasticsearchTimeoutException is thrown it does not
report which shard failed or have any detail unlike the SearchResponse.
Isn't that a little weird that the SearchResponse can report specific shard
timeouts but the ElasticsearchTimeoutException cannot?

Thanks.

@Test
public void testSearchTimeoutReporting() {
    Settings settings = ImmutableSettings.builder()

.put(GroovyScriptEngineService.GROOVY_SCRIPT_SANDBOX_ENABLED, "true")
.put("script.disable_dynamic", "false")
.put("script.default_lang", "groovy")
.put("script.groovy.sandbox.receiver_whitelist",

"com.appdynamics.analytics.processor.elasticsearch.exception.DetailedExceptionTest")
.put(new
ElasticSearchTestSingleNodeModule().buildSettings())
.build();

    Node node = NodeBuilder.nodeBuilder()
            //No automatic/magic loading from classpath.
            .loadConfigSettings(false)
            .settings(settings)
            .node();
    Client client = node.client();

    client.admin().indices().prepareCreate("test")
            .execute().actionGet();

    client
            .prepareIndex("test", "type", "1").setSource("field", 

"value").setRefresh(true)
.execute().actionGet();

    try {
        client
                .prepareSearch("test")
                .setTimeout(TimeValue.timeValueMillis(1))
                .setQuery(filteredQuery(matchAllQuery(),
                        scriptFilter(

"com.appdynamics.analytics.processor.elasticsearch.exception.DetailedExceptionTest.scriptCall();
return true;")))
.execute()
//.actionGet(TimeValue.timeValueMillis(5));
.actionGet();
} catch (ElasticsearchTimeoutException e) {
e.printStackTrace();
}
}

Map<String, String> buildSettings() {
Map<String, String> nodeSettings = new HashMap<>();
nodeSettings.put("gateway.type", "none");
nodeSettings.put("node.name", "node-" +
UUID.randomUUID().toString());
nodeSettings.put("node.master", "true");
nodeSettings.put("cluster.name", UUID.randomUUID().toString());
nodeSettings.put("node.data", "true");
nodeSettings.put("node.local", "true");
nodeSettings.put("discovery.zen.ping.multicast.enabled", "false");
nodeSettings.put("http.enabled", "false");

    nodeSettings.put("index.store.type", "memory");
    nodeSettings.put("index.store.fs.memory.enabled", "true");
    nodeSettings.put("index.gateway.type", "none");
    nodeSettings.put("index.number_of_shards", "1");
    nodeSettings.put("index.number_of_replicas", "0");

    nodeSettings.put("path.data", "build/data");

    //don't auto create the index
    nodeSettings.put("action.auto_create_index", "false");

    return nodeSettings;
}

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a44d89ff-a825-46b8-837b-0f54f9555234%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.