Skip to content

fix: prevent TCP stream destruction from starving shutdown - #2

Merged
acking-you merged 1 commit into
devfrom
codex/fix-tcp-shutdown
Oct 18, 2026
Merged

acking-you merged 1 commit into
devfrom
codex/fix-tcp-shutdown

Conversation

@acking-you

Copy link
Copy Markdown
Owner

Dropping many TCP streams could exhaust Tokio's blocking pool while each destructor waited for a packet worker on the same executor. This prevented tunnel shutdown and its deadline from progressing.

Cancel the owned worker without blocking in Drop. Its removal sender is dropped even if the task never ran, so the session table watcher still removes the entry. Keep asynchronous FIN handling and explicit peer-reset behavior unchanged.

Validation:

  • cargo test --manifest-path deps/ipstack/Cargo.toml (37 unit/doc tests)
  • cargo clippy --manifest-path deps/ipstack/Cargo.toml --all-targets --all-features -- -D warnings
  • cargo fmt --manifest-path deps/ipstack/Cargo.toml -- --check
  • The new bounded-runtime regression failed on the old implementation and passes with this fix.
  • Parent integration exercised 128 live TCP sessions for Legacy/V3 with direct and relay upstreams, DNS and IPv4/IPv6 UDP, then checked cancellation and listener release.

No public API or wire-format changes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T11:20:16.979151Z e3c5645 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@acking-you
acking-you merged commit 89cea63 into dev Oct 18, 2026
4 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