fix(net): preserve TCP listeners when accept slots are exhausted - #2316
Merged
fslongjin merged 2 commits intoSep 21, 2026
Merged
Conversation
A live TCP listener can consume all physical smoltcp accept slots. Previously a subsequent SYN fell through normal demultiplexing and received a closed-port RST; the pre-stack filter only covered zero backlog and predicted slot availability before TCP validation. Replace the receive-path backlog predictor with a per-interface logical listener registry. Register address domains and reservation identities on listen, unregister on shutdown or close, and let smoltcp consult these facts only after normal TCP matching fails. Remove raw packet filtering and repeated poll-time slot scans while preserving existing address-family isolation and relisten capacity behavior. Pin smoltcp dff45e4d40ee043fd3060d33404606548daab17d (DragonOS-Community/smoltcp#30). Add 12 dunitest cases covering saturated positive and zero backlog recovery, closed-port refusal, and address-family isolation; enable them in the mandatory test lists. Validation: make kernel, make fmt and FMT_CHECK=1 make fmt passed. All 123 focused guest tests passed with the remote pinned dependency. The same guest nginx curl burst improved from 61/64 to 64/64; a final 16-thread HTTP run passed 1000/1000. This addresses erroneous resets under slot pressure, not all concurrent nginx failures: host-forwarding timeouts and an earlier isolated guest failure remain separate unresolved observations. Signed-off-by: longjin <longjin@dragonos.org>
Member
Author
|
@codex review |
Update the manifest and lockfile to 225c271ef40fa483c60a8f69c8d000d2af58a483, merged by DragonOS-Community/smoltcp#30 into dragonos/v0.12.0. The merged commit has the same Git tree as the previously tested dff45e4 revision. make kernel passes with the merged dependency. Signed-off-by: longjin <longjin@dragonos.org>
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.
Root cause
A live listener has a bounded set of physical smoltcp slots. When all slots are occupied, a new SYN previously reached the closed-port RST fallback. The receive-path predictor only protected zero backlog and ran before TCP validation.
Changes
Dependency / merge order
DragonOS-Community/smoltcp#30 has merged into dragonos/v0.12.0. The dependency pin now references its merged commit, 225c271ef40fa483c60a8f69c8d000d2af58a483, whose Git tree is identical to the previously tested commit.
Validation
Explicit limitations
This fixes erroneous resets on slot exhaustion, not all concurrent nginx problems. The unchanged host-forwarded load still had 42/1000 timeouts; phase-level investigation found predominantly host connect timeouts and QEMU host-listener backlog 1, plus unresolved response-header timeouts. An initial guest threaded run had one failure before subsequent full passes. A pre-existing early-accept SynReceived semantic issue also remains separate. No timeout increase, application retry workaround, or larger slot cap is used to mask these observations.