Fix interactive tunnel latency and bound connection setup - #10
Merged
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Merged
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Interactive RPC traffic can stall on the local TCP legs of a tunnel even when the relay sockets already use
TCP_NODELAY. Subscriber-to-relay and publisher-to-service connection attempts can also outlive the SDK's control I/O deadline. This fixes both issues found while investigating Pocket-Codex session switching.Related Issues
Companion Pocket-Codex fix: acking-you/pocket-codex#92.
Change Type
What Changed
Verification
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace— 207 passed, 3 ignored; the subsequently addedtcp_forward_disables_nagle_on_the_local_legtest also passed.The tunnel integration tests measured small-message P95 around 2.1 ms in both codec modes after the large transfer. A combined build with the Pocket-Codex fixes completed 300 real bridge session switches over a local relay on one WebSocket with zero disconnects: median 13.8 ms, P95 45.5 ms, maximum 63.3 ms.
Compatibility / Risk
No wire-format, CLI, or dependency-version changes. TCP connection attempts now fail within the existing control I/O deadline. Disabling Nagle can increase packet counts for small writes.
The session benchmark used isolated historical fixtures and warm local caches; it is not a public-network latency guarantee or an isolated measurement of the Nagle change. The fixed commit is also available on the dedicated
pocket-codexbranch. Companion PR acking-you/pocket-codex#92 consumes that Git branch, with the exact commit pinned in Cargo.lock, so it does not need to wait for a registry release.