Skip to content

[WIP] STOR-5489: Implement retry loop for actor fetch requests - #7064

Open
apeacock1991 wants to merge 6 commits into
mainfrom
apeacock/stor-5489-replay
Open

[WIP] STOR-5489: Implement retry loop for actor fetch requests#7064
apeacock1991 wants to merge 6 commits into
mainfrom
apeacock/stor-5489-replay

Conversation

@apeacock1991

@apeacock1991 apeacock1991 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

[NOT READY FOR REVIEW]
When the enforcement gate is enabled, we now attempt to retry disconnected actor requests within the following bounds:

  • The request is eligible for retries (e.g. is fetch, is rewindable, is WebSocket upgrade request)
  • Retry up to maximum of 5 times
  • Retry up to a maximum of 10 seconds, with backoff

Importantly, retries do not contribute to the subrequest limit which are cumulative. This can be changed, but it felt reasonable to consider 1 req == 1 subrequest plus if we retried 5 times, that would use 10% of the subrequest budget (for free).

There's some cleanup in this PR too:

  • Renamed supportsActorRetryMetadata to supportsActorFetchRetries, ultimately this is what we care about vs metadata
  • Extracted out some existing tests to a new test suite that is specifically for retries

@apeacock1991
apeacock1991 requested review from a team as code owners August 19, 2026 12:13
@apeacock1991
apeacock1991 force-pushed the apeacock/stor-5489-replay branch from a40b874 to 05599f4 Compare August 19, 2026 13:25
Use supportsActorFetchRetries() for the existing metadata capability so the name also covers replay behavior added separately.
Add a retry-preparation hook to actor fetch factories. Global actor stubs drop and recreate their channel while preserving routing inputs; replica stubs retain their pre-opened primary channel.
Move the existing actor retry metadata and factory tests into their
own target. Leave body rewindability coverage isolated.
@apeacock1991
apeacock1991 force-pushed the apeacock/stor-5489-replay branch from 05599f4 to 14373e2 Compare August 19, 2026 13:55
@codspeed-hq

codspeed-hq Bot commented Aug 19, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 9.64%

⚡ 1 improved benchmark
✅ 71 untouched benchmarks
⏩ 129 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
request[RegExpBenchmark] 4.5 ms 4.1 ms +9.64%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing apeacock/stor-5489-replay (38a5707) with main (5ef8a1f)

Open in CodSpeed

Footnotes

  1. 129 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@apeacock1991
apeacock1991 force-pushed the apeacock/stor-5489-replay branch from 14373e2 to bd4d554 Compare August 19, 2026 14:17
Retry eligible Durable Object HTTP fetches with bounded jittered
backoff while preserving logical-call metadata, rewinding request
bodies, and honoring delivery, abort, and deadline semantics.
Apply Durable Object fetch replay to disconnected WebSocket upgrade
handshakes while retaining the existing successful upgrade and HTTP
fallback behavior.
Count the initial Durable Object fetch against the per-invocation
subrequest budget, but bypass the check for physical replay attempts.
This preserves one budget unit per logical fetch even when delivery is
retried.
@apeacock1991
apeacock1991 force-pushed the apeacock/stor-5489-replay branch from bd4d554 to 38a5707 Compare August 19, 2026 15:00
@apeacock1991 apeacock1991 changed the title STOR-5489: Implement retry loop for actor fetch requests [WIP] STOR-5489: Implement retry loop for actor fetch requests Aug 19, 2026
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.

1 participant