Skip to content

fix(http): await bounded connection teardown - #2

Merged
danielkov merged 2 commits into
feat/unstable-v2-session-injectfrom
fix/bounded-graceful-teardown
Sep 29, 2026
Merged

danielkov merged 2 commits into
feat/unstable-v2-session-injectfrom
fix/bounded-graceful-teardown

Conversation

@danielkov

Copy link
Copy Markdown
Owner

Summary

Restore connection teardown in the bounded HTTP client: graceful and error exits await a best-effort DELETE for an admitted connection ID. Teardown has a five-second deadline and does not consume response bodies.

Motivation

The bounded driver previously returned on graceful outgoing EOF without deleting the remote connection, unlike the legacy client. Callers awaiting transport completion could therefore leave initialized connections behind.

Technical details

A single-owner cleanup guard captures validated, budgeted connection metadata before reading the initialization body and retains its lease through teardown. Driver-owned streams and POSTs stop before DELETE begins, and cleanup failures do not replace the transport result.

Cancellation dispatches at most one best-effort cleanup task per connection if teardown has not started and a Tokio runtime is available. It can interrupt an already-started DELETE and never guarantees remote deletion. Accepted or uncertain POSTs are not retried.

@danielkov

Copy link
Copy Markdown
Owner Author

Independent code review (agent teardown-review) approved exact HEAD 1dedc0148b6c6e4c7fa497636b99b70c8fc76da7 against e18fd153fdd0118cf3b5031724165744a689ac27 with no actionable findings. This records an actual independent code/test inspection, not a GitHub account approval.

Audited: five-second headers-only DELETE; dropping inner streams/POSTs before cleanup; original transport-error preservation; graceful inbound-response preservation, including cancellation during cleanup; at most one cleanup dispatch per admitted connection; metadata budget lease retained through cleanup; no automatic POST retry. Five loopback HTTP regressions cover these failure and shutdown paths.

Local exact-head checks: HTTP suite 107 unit tests and 5 interoperability tests passed; strict all-targets/all-features HTTP clippy passed. Full repository recipe and remote checks are still pending. Cleanup remains best effort and does not guarantee remote deletion when cancellation interrupts DELETE.

@danielkov
danielkov merged commit 3e20af1 into feat/unstable-v2-session-inject Sep 29, 2026
11 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