Commit 0a624ea
committed
fix: restrict DispatchingTransport retries to transient failures only
sendAsync retried on any non-null error, wasting the retry budget on
permanent 4xx failures. The exception hierarchy made this subtle:
ResponseException and TransportException both extend IOException, so a
naive instanceof-IOException check would retry HTTP 400/401/403/404/405
(delivered as ElasticsearchException via the LLRC ignore list) and HTTP
409 Conflict (delivered as ResponseException).
Add isRetryable(Throwable): retry genuine transport failures (IOException
subclasses that are neither ResponseException nor TransportException),
HTTP 429 and HTTP 5xx (transient server pressure); do not retry
ElasticsearchException (permanent app-level 4xx), TransportException
(infrastructure misconfiguration), or ResponseException for other 4xx.
Residual note: retrying IOException on bulk requests with
use.autogenerated.ids=true can still create duplicate documents if ES
applied operations before the connection dropped. This cannot be resolved
inside DispatchingTransport without external versioning or ES-side
deduplication.1 parent 4c357d9 commit 0a624ea
1 file changed
Lines changed: 27 additions & 4 deletions
Lines changed: 27 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
760 | 763 | | |
761 | 764 | | |
762 | 765 | | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
| 766 | + | |
767 | 767 | | |
768 | 768 | | |
769 | 769 | | |
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
781 | 804 | | |
782 | 805 | | |
783 | 806 | | |
| |||
0 commit comments