async-http-client icon indicating copy to clipboard operation
async-http-client copied to clipboard

Option for `HTTPClientError.remoteConnectionClosed`s to be automatically retried

Open MahdiBM opened this issue 2 years ago • 1 comments

In all apps i've used AHC in, we experience relatively-infrequent but consistent HTTPClientError.remoteConnectionCloseds. Frequency-wise, my non-scientific approximation would be something like 1/50_000 requests (depends on a lot of factors of course).

These errors seem to happen consistently due to usual network inconsistencies, and they almost never indicate any actual problems on user's side.

I expect AHC to be able to automatically retry these errors so users have a more consistent experience when making requests. Perhaps there could be a setting like the existing retryConnectionEstablishment.

Worths mentioning that I do also see other kinds of errors here and there, but only inconsistently and much less frequently, so i don't think the other errors are worth retrying, unlike remoteConnectionClosed.

MahdiBM avatar Oct 29 '23 22:10 MahdiBM

Yes, this seems like a good feature request. @dnadoba can you have a think about when we could tackle proper retry support?

Lukasa avatar Nov 06 '23 09:11 Lukasa