feat(rust): bind non-owning ping handles before initialization - #490
Open
Auro (aurokin) wants to merge 1 commit into
Open
Auro (aurokin) wants to merge 1 commit into
Auro (aurokin) wants to merge 1 commit into
Conversation
Share normal request correlation with transport-owned keepalive without retaining the client driver. Keep managed-host request IDs across retries and clean up cancelled requests deterministically. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Auro (aurokin)
requested review from
Connor Peet (connor4312) and
roblourens
as code owners
October 1, 2026 22:28
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
This branch has not been deployed
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
Allow transport-owned keepalive to use SDK request correlation while a managed host is initialized but still awaiting session discovery. Add the optional, synchronous
Transport::bind_client(WeakPingHandle)callback before client transport I/O, with default no-op implementations and forwarding throughDynTransportandBoxedTransport.Ownership and compatibility
WeakPingHandleexposes onlyping, sharing the normal root-channel request, request IDs, pending response map, outbound queue, and configured timeout. Neither the handle nor an unanswered ping retains the client driver. Last-client drop, shutdown, and transport closure cancel weak pings deterministically; normal request RPC teardown errors and timeout behavior remain unchanged. Dropping request futures removes pending entries.Managed hosts privately retain one request-ID allocator across connection attempts, including failed handshakes, so delayed replies from a previous transport cannot match a new request. Independent logical hosts and standalone clients retain independent sequences. The allocator uses the full
u64range through its maximum and fails explicitly on exhaustion without wrapping. No public allocator/configuration API, wire changes, dependencies, or provider-specific keepalive policy are introduced.Validation
cargo test --manifest-path clients/rust/Cargo.toml -p ahp -p ahp-ws --locked: 79 unit/integration tests and 14 doctests pass.cargo fmt --manifest-path clients/rust/Cargo.toml --all --checkpasses.cargo clippy --manifest-path clients/rust/Cargo.toml -p ahp --lib --tests --locked -- -D warningspasses.npm testandnpm run verify:change-fragmentspass.Release
Includes Rust API documentation and a Rust-only changelog fragment. This change does not bump versions, create tags, or publish packages. A subsequent maintainer-owned Rust release is required before tag-pinned downstream adoption.