# Select Timeout parameter for python helper async\_bulk

**URL:** <https://discuss.elastic.co/t/select-timeout-parameter-for-python-helper-async-bulk/338037>\
**Category:** Elasticsearch\
**Created:** [July 10, 2023, 4:38pm UTC](https://discuss.elastic.co/t/select-timeout-parameter-for-python-helper-async-bulk/338037 "2023-07-10T16:38:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ionFreeman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ionfreeman/32/122785_2.png) [@ionFreeman](https://discuss.elastic.co/u/ionFreeman)\
**Post date:** [July 10, 2023, 4:38pm UTC](https://discuss.elastic.co/t/select-timeout-parameter-for-python-helper-async-bulk/338037/1 "2023-07-10T16:38:43Z")

</div>

Hello! Every so often, my async\_bulk load fails with a Connection Timeout. I have my timeout parameter set to 60; I had set it arbitrarily high, but it didn't pass code review. I can't just wrap the call in tenacity as I can't really expect it to rewind the generator.

What's the best practice for selecting a timeout?

I don't know how often it fails. Each of my load jobs does a few hundred 500-document batches, and one in eleven of the jobs fail, so call it one in every five thousand times.

Also... the docs say async\_bulk will only retry on 429 (too many requests) response status. Is that the case? Will it retry on Connection Timeout?

---

<div class="post-metadata">

**Author:** ![ionFreeman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ionfreeman/32/122785_2.png) [@ionFreeman](https://discuss.elastic.co/u/ionFreeman)\
**Post date:** [July 12, 2023, 2:53pm UTC](https://discuss.elastic.co/t/select-timeout-parameter-for-python-helper-async-bulk/338037/2 "2023-07-12T14:53:22Z")

</div>

I checked the code. It will only retry on 429s.

---

<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:** [August 9, 2023, 2:54pm UTC](https://discuss.elastic.co/t/select-timeout-parameter-for-python-helper-async-bulk/338037/3 "2023-08-09T14:54:09Z")

</div>

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