Skip to content

fix(gateway): apply bounded backpressure during session replay - #264

Merged
danielkov merged 2 commits into
mainfrom
fix/gateway-replay-backpressure
Oct 6, 2026
Merged

danielkov merged 2 commits into
mainfrom
fix/gateway-replay-backpressure

Conversation

@danielkov

@danielkov danielkov commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Apply bounded backpressure to gateway output so session-history replay does not terminate healthy connections when retained HTTP frames temporarily fill admission capacity. Drain admitted bridge frames before driving additional HTTP work.

Technical details

Wait for retained frame ownership to end

Gateway output awaits actual frame/byte reservation release rather than relying on scheduler yields. One absolute five-second deadline covers the response, actor polls, and output from all controllers in a drain. Progress does not reset the deadline or renew leases while another controller waits; expiry terminates the connection. Queue capacities and frame-size limits are unchanged.

Pin the matching transport correction

Pin the ACP HTTP and core SDK crates to 03eab519aa5ecfc97a43bf17f9721c38c065c47b from danielkov/rust-sdk#4. That revision adds cancellation-safe awaitable admission and cooperative incoming SSE delivery. The core and HTTP crates share one source revision to preserve channel type identity; package versions remain unchanged.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slow-progress replay can outlast the controller lease because output waiting is bounded per frame rather than across the drain interval.

Comment thread src/gateway/http_server.rs Outdated

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

@danielkov
danielkov merged commit 687c5ce into main Oct 6, 2026
7 checks passed
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