Skip to content

Reliability under injected faults ​

Documentation for 2.7.x

This documents rust-fetch 2.7.x. For the latest version, see the current documentation. The changelog lists what 2.8 added.

Generated by npm run reliability:compare. Local loopback server, full body consumption, retries disabled, three rounds per case. Each client gets its own 150 ms timeout; the shared 1,000 ms abort watchdog is reported as watchdog, rather than credited to the client. HTTP error statuses are normalized so exception defaults do not determine the result.

Versions: Node v22.23.3; axios 1.20.0; ky 2.2.0; got 15.1.0; undici 7.30.1. rust-fetch is the 2.7.0 implementation.

Faultrust-fetch/nativerust-fetch/node:httpfetchundiciaxioskygot
successok (1 ms)ok (1 ms)ok (4 ms)ok (3 ms)ok (5 ms)ok (2 ms)ok (1 ms)
resetnetwork (1 ms)network (1 ms)network (5 ms)network (3 ms)network (1 ms)network (1 ms)network (1 ms)
truncatednetwork (1 ms)network (1 ms)network (4 ms)network (3 ms)network (2 ms)network (2 ms)network (1 ms)
oversizedHeadersnetwork (5 ms)network (3 ms)network (4 ms)network (35 ms)network (3 ms)network (3 ms)network (2 ms)
stalledHeaderstimeout (153 ms)timeout (152 ms)timeout (152 ms)timeout (151 ms)timeout (151 ms)timeout (154 ms)timeout (155 ms)
stalledBodytimeout (152 ms)timeout (152 ms)timeout (152 ms)timeout (151 ms)network (152 ms)timeout (154 ms)timeout (156 ms)
trickleBodytimeout (152 ms)timeout (152 ms)timeout (152 ms)timeout (151 ms)watchdog (1001 ms)timeout (151 ms)timeout (155 ms)
redirectLoopnetwork (6 ms)network (11 ms)network (22 ms)network (8 ms)network (12 ms)network (7 ms)network (8 ms)
rateLimitedhttp:429 (1 ms)http:429 (1 ms)http:429 (1 ms)http:429 (0 ms)http:429 (1 ms)http:429 (1 ms)http:429 (1 ms)
unavailablehttp:503 (1 ms)http:503 (1 ms)http:503 (1 ms)http:503 (0 ms)http:503 (1 ms)http:503 (1 ms)http:503 (1 ms)

The table measures these configurations and faults, not a general reliability ranking. Network error names differ. Some clients reject oversized headers sooner; lower failure latency is not necessarily better error handling. Axios uses an inactivity timeout, so a peer that keeps sending bytes can outlive its timeout. A total deadline or AbortSignal is needed for that case. The fault server and raw results are committed under benchmarks/reliability/.

CI runs the fault cases in the transport conformance matrix on native, node:http, fetch, Chromium, Firefox and WebKit. Dedicated WebSocket/SSE tests cover drops, reconnects, silent idle timeouts, cancellation bursts and server restarts. The Node comparison also fails if either rust-fetch transport misses an expected outcome or needs the watchdog.

Sixteen concurrent SSE streams and sixteen WebSockets also face repeated immediate closes in every adapter, checking recovery, retry counts and jitter bounds. Each storm must recover within 30 seconds (SSE within 5 seconds), allowing for browser connection scheduling in addition to configured backoff. Separate Node listener-restart tests drop all sixteen live connections, stop accepting for 50 ms, then reopen the same port; SSE must resume with Last-Event-ID and both APIs must recover with jittered backoff.

Gap decisions ​

  • WebSocket silent stalls use opt-in idleTimeoutMs, reset on received messages, and the existing reconnection policy. No unsolicited ping messages are sent: browser WebSocket does not expose control ping frames, and an application heartbeat must match the server protocol.

  • SSE uses idleTimeoutMs and the existing reconnect/jitter policy. Comment keep-alives count as activity. Both APIs retain the documented rule that opening a connection resets consecutive-retry failures; retries remain spaced by configured backoff. A lifetime reconnect cap would change that policy and is not introduced here.

  • DNS and TLS failures, refused connections, server restarts, socket limits, overload and bounded streams have dedicated existing transport/security tests. They complement this deterministic comparison; DNS and TLS browser errors expose fewer details than Node.

  • HTTP/2 and automatic replay of a one-shot upload remain outside this release. A body factory is required for a replayable streaming upload.

Reproduce ​

Run npm ci, npm run build, npm run build:native, then npm run reliability:compare on Node 22+. Raw outcomes, elapsed times, timeout settings, dependency versions and the bundle fingerprint are in the generated JSON.

Released under the MIT or Apache-2.0 license.