Skip to content

fix: preserve transport response failures - #379

Open
jterapin wants to merge 7 commits into
mainfrom
fix/transport-response-errors
Open

jterapin wants to merge 7 commits into
mainfrom
fix/transport-response-errors

Conversation

@jterapin

@jterapin jterapin commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

Failures in response callbacks or body cleanup can be lost after completion. Late headers or data can also modify a completed response. HTTP-method lookup can resolve constants that are not request classes.

Customer impact

A callback failure is no longer silently treated as success. Retry eligibility follows V3's error classes and HTTP status rules.

Fix

  • Preserve the first response failure, run completion cleanup once per attempt, and notify error listeners after completion callbacks.
  • Use the V3 network-error classes when handling caught transport, callback, and body-processing exceptions. Preserve other exceptions and retain the original cause when wrapping a network error.
  • Ignore headers and data after completion, and reset response state before another attempt.
  • Reject HTTP-method constants that are not Net::HTTP request subclasses.
  • Simplify transport dispatch, clarify the touched comments, and correct the networking-error and backoff signatures.

Testing

Local checks ran on Ruby 4.0.4. AWS V4 validation used the modified Smithy runtime through Bundler local overrides.

  • smithy-client specs: 951 examples, 0 failures, 2 existing pending.
  • RBS validation and spy specs: 901 examples, 0 failures, 2 existing pending.
  • AWS V4 protocol suites: 1,106 examples, 0 failures, 4 existing pending.
  • RuboCop: 374 files inspected, no offenses. git diff --check passed.
  • An offline comparison against V3 matched all 15 callback/error/status cases. Mocked S3 calls verified callback errors, retries, cleanup counts, and retry limits.

🤖 This PR description was drafted with AI assistance and reviewed by @jterapin. ✨

@jterapin
jterapin marked this pull request as ready for review October 15, 2026 16:38
@jterapin
jterapin requested review from a team as code owners October 15, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants