Skip to content

Fallback host selection gaps: request timeout and CloudFront header (RSC15l, RSC15l4) #2197

@paddybyers

Description

@paddybyers

Spec points

  • RSC15l: When a request times out after the connection is established (request-level timeout), the client should retry on a fallback host, just as it does for connection-level timeouts.
  • RSC15l4: When a response includes a `Server: CloudFront` header with status >= 400, the client should treat it as a server error and retry on a fallback host.

Observed behaviour

RSC15l — Request timeout

Request-level timeouts propagate as errors without triggering fallback retry. Only connection-level errors (refused, DNS, timeout before connection) and HTTP 500–504 trigger fallback. The `shouldFallback` method does not consider request-level timeouts.

RSC15l4 — CloudFront header

`shouldFallback` in `http.ts` only checks for specific errno codes and HTTP 500–504 status codes. It does not inspect the `Server` response header. CloudFront errors with 4xx status codes are treated as non-retryable client errors.

Failing tests (2)

Test Expected Actual
`RSC15l - request timeout triggers fallback` Retry on fallback host after request timeout Error thrown, no retry
`RSC15l4 - CloudFront Server header triggers fallback` Retry on fallback host on CloudFront 403 Error thrown, no retry

Reproduction

```bash
RUN_DEVIATIONS=1 npx mocha --grep "RSC15l" test/uts/rest/fallback.test.ts
```

From PR #2191, branch `uts-rest`.

┆Issue is synchronized with this Jira Task by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. It's clear that this does need to be fixed.uts-issueIssues raised there there is an apparent discrepancy between this library and the UTS tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions