# Bulk retry drops whole BulkResponse if only one BulkItemResponse can not be retried

**URL:** <https://discuss.elastic.co/t/bulk-retry-drops-whole-bulkresponse-if-only-one-bulkitemresponse-can-not-be-retried/272936>\
**Category:** Elasticsearch\
**Created:** [May 13, 2021, 4:41pm UTC](https://discuss.elastic.co/t/bulk-retry-drops-whole-bulkresponse-if-only-one-bulkitemresponse-can-not-be-retried/272936 "2021-05-13T16:41:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chobicus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chobicus/32/88720_2.png) [@Chobicus](https://discuss.elastic.co/u/Chobicus)\
**Post date:** [May 13, 2021, 4:41pm UTC](https://discuss.elastic.co/t/bulk-retry-drops-whole-bulkresponse-if-only-one-bulkitemresponse-can-not-be-retried/272936/1 "2021-05-13T16:41:04Z")

</div>

Hello. Not sure if [canRetry method](https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/action/bulk/Retry.java#L142-L155) is intended to behave like this.

I have an index where sometimes I try to index the document that is already indexed getting `CONFLICT(409)` which is fine and **should not be retried**.  
Sometimes, when under pressure, ES might respond with `TOO_MANY_REQUESTS(429)` to some of the items in the bulk. These **should be retried**.

When the combination of these responses ends up in `BulkResponse` `canRetry` returns false and nothing is retried.

I would expect that canRetry is applied to each `BulkItemResponse` and based on that retried or not.

Is this intended?

---

<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:** [June 10, 2021, 4:41pm UTC](https://discuss.elastic.co/t/bulk-retry-drops-whole-bulkresponse-if-only-one-bulkitemresponse-can-not-be-retried/272936/2 "2021-06-10T16:41:51Z")

</div>

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