# Bulkprocessor Indexing Timeout

**URL:** <https://discuss.elastic.co/t/bulkprocessor-indexing-timeout/73271>\
**Category:** Elasticsearch\
**Created:** [January 30, 2017, 7:25pm UTC](https://discuss.elastic.co/t/bulkprocessor-indexing-timeout/73271 "2017-01-30T19:25:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![putkarsh](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@putkarsh](https://discuss.elastic.co/u/putkarsh)\
**Post date:** [January 30, 2017, 7:25pm UTC](https://discuss.elastic.co/t/bulkprocessor-indexing-timeout/73271/1 "2017-01-30T19:25:02Z")

</div>

Each bulk request in the bulk processor waits over a semaphore whose max value is controlled by number of concurrent requests param given in the settings for the bulk processor. So lets say this value was configured to be 16, which means after the bulk processor has sent 16 requests it will wait for the response of at least one of these 16 requests to come back before sending the 17th request to cluster.

Now let's say if the ES cluster is responding too slow and is taking few minutes to respond to one bulk request or in worse case is not available after the bulk request has got into the cluster, will the bulk processor infinitely wait in a hope to get response from the cluster ?

In short, I want to know is there any timeout configured for such scenarios. If yes, can we modify it ?

---

<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:** [January 31, 2017, 5:45pm UTC](https://discuss.elastic.co/t/bulkprocessor-indexing-timeout/73271/2 "2017-01-31T17:45:45Z")

</div>

Yes, bulk requests never time out.

You could try patching the `org.elasticsearch.action.bulk.BulkAction` class. It is missing the timeout setting in the options.

Replace

```auto
 @Override
    public TransportRequestOptions transportOptions(Settings settings) {
        return TransportRequestOptions.builder()
                .withType(TransportRequestOptions.Type.BULK)
                .withCompress(settings.getAsBoolean("action.bulk.compress", true)
                ).build();
    }

```

with

```auto
 @Override
    public TransportRequestOptions transportOptions(Settings settings) {
        return TransportRequestOptions.builder()
                .withType(TransportRequestOptions.Type.BULK)
                .withTimeout(settings.getAsTime("action.bulk.timeout", TimeValue.timeValueSeconds(60)))
                .withCompress(settings.getAsBoolean("action.bulk.compress", true)
                ).build();
    }

```

and then you have a timeout on your bulk requests, by default 60 seconds, or change the configuration parameter `action.bulk.timeout`. (There may be more work left to do to let ES know about the new configuration parameter.)

---

<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:** [February 28, 2017, 5:45pm UTC](https://discuss.elastic.co/t/bulkprocessor-indexing-timeout/73271/3 "2017-02-28T17:45:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
