# Timeout when ES is dead

**URL:** <https://discuss.elastic.co/t/timeout-when-es-is-dead/111246>\
**Category:** Elasticsearch\
**Created:** [December 12, 2017, 6:43am UTC](https://discuss.elastic.co/t/timeout-when-es-is-dead/111246 "2017-12-12T06:43:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Davidovich](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Alex\_Davidovich](https://discuss.elastic.co/u/Alex_Davidovich)\
**Post date:** [December 12, 2017, 6:43am UTC](https://discuss.elastic.co/t/timeout-when-es-is-dead/111246/1 "2017-12-12T06:43:55Z")

</div>

I have 3 nodes cluster and when I kill 2 I expect ES to reject my bulk index requests. (Defined minimum of 2 nodes in cluster).  
ES does reject my bulk index request but it takes 1 minute. What timeout can I configure in order to get the reject earlier?

This line of code didn't help for some reason, can someone also explain what is this timeout?

```auto
bulkRequestBuilder.add(indexRequestBuilder.setSource(eventJson.getValue(), XContentType.JSON).setCreate(true).setTimeout(TIMEOUT));

```

Thanks

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [December 15, 2017, 11:11am UTC](https://discuss.elastic.co/t/timeout-when-es-is-dead/111246/2 "2017-12-15T11:11:14Z")

</div>

you should be able to set `BulkRequestBuilder#setTimeout(TimeValue)` to do this.

---

<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:** [January 12, 2018, 11:11am UTC](https://discuss.elastic.co/t/timeout-when-es-is-dead/111246/3 "2018-01-12T11:11:19Z")

</div>

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