Skip to content

v5.7.4 - Stale Connection Resets Are Retried

Latest

Choose a tag to compare

@AdrianCurtin AdrianCurtin released this 08 Sep 14:46
d7de7ba

Reset keep-alive connections retry instead of raising a raw Faraday error

A focused fix release for the request retry mechanism. The SDK's persistent
connection pool could hand a request a connection the server or a load
balancer had already closed after idling; the request then failed immediately
with a raw Faraday::ConnectionFailed (Errno::ECONNRESET) even though an
immediate re-send on a fresh connection succeeds. Reset connections now retry
under the same idempotency rules as read timeouts.

Changes

  • FIXED: Parse::Client#request now rescues Faraday::ConnectionFailed
    and splits it on the wrapped cause. Reset-class causes (Errno::ECONNRESET,
    Errno::EPIPE, Errno::ECONNABORTED, and the EOFError raised when the
    remote end closes a keep-alive socket cleanly) are transient, so idempotent
    requests (GET, DELETE, op-free PUT, and any write covered by asserted
    server-side request-id dedup) retry with the standard linear backoff and
    jitter. Connection refused and DNS failures keep the previous fail-fast
    behavior and propagate the raw Faraday::ConnectionFailed with no retry
    latency. POSTs and atomic-op PUTs are still never replayed without server
    dedup, since a reset mid-write leaves the outcome unknown.
  • CHANGED: A reset connection that persists through the whole retry budget
    now raises Parse::Error::ConnectionError, consistent with the read-timeout
    path, instead of the raw Faraday::ConnectionFailed. Code that rescued
    Faraday::ConnectionFailed to catch resets should rescue
    Parse::Error::ConnectionError instead; refused and DNS failures still
    raise Faraday::ConnectionFailed.
  • CHANGED: Bumped locked dependencies and CI actions to their latest
    compatible releases: graphql 2.6.8 → 2.6.10, github/codeql-action
    4.37.6 → 4.37.9, and rubygems/release-gem 1.4.0 → 1.4.1.

Behavior Notes

Retries apply only to requests whose replay is safe. A reset during a
non-idempotent write still fails immediately, now as
Parse::Error::ConnectionError, so nothing can double-apply.

Commit: d7de7ba
Author: Adrian Curtin
Date: September 8, 2026