swift-server / swift-server/async-http-client

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

Open
#715 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
1.1k
Forks
156
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the issue. Start by locating the existing retryConnectionEstablishment setting and tracing how HTTPClientError.remoteConnectionClosed is handled. Done means providing an option for these errors to be retried automatically without extending retries to the other error kinds described.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.