We only retry by default on 502 and 503.
Elasticsearch PY only retries on 503. 504
perl only on 503.
I think it makes sense to also add 504 to the list
The reason we don't simply retry on >=500 is because 500 can be used to signal valid bad states that should not be retried:
https://github.com/elastic/elasticsearch/search?p=1&q=INTERNAL_SERVER_ERROR&utf8=%E2%9C%93
Which I think is the correct status code, @elastic/es-clients do you see different HTTP status codes Elasticsearch could be returning in the previous cases, clearing the 500 range? Do we all want/need to settle on 502, 503, 504 collectively?
Do we all want/need to settle on 502, 503, 504 collectively?
+1
+1, will add it to python, do we also want to document it in ES itself for ES devs and other client authors? Where would be a good place?
Most helpful comment
The reason we don't simply retry on
>=500is because500can be used to signal valid bad states that should not be retried:https://github.com/elastic/elasticsearch/search?p=1&q=INTERNAL_SERVER_ERROR&utf8=%E2%9C%93
Which I think is the correct status code, @elastic/es-clients do you see different HTTP status codes Elasticsearch could be returning in the previous cases, clearing the 500 range? Do we all want/need to settle on
502, 503, 504collectively?