Conversation
Accept repeated listen calls in the Listening state instead of rejecting the normal nginx backlog configuration path with EINVAL. Normalize the syscall int backlog using the Linux unsigned somaxconn comparison. Share bounded per-interface slot growth between initial and repeated listening so wildcard listeners can grow on every covered interface. Retain address-family domains and port reservations, preserve pending connections on shrink, and retire excess slots on accept or existing event notifications. Reclaim Closed slots before healthy listeners and rearm retained reset children under the SocketSet lock. Remove the cached accept index so resizing cannot leave stale indices. Preserve the receive-policy cache when updating an existing listener registration. Add 40 dunitest cases covering IPv4/IPv6, specific/wildcard addresses, repeated listen, growth, shrink, reset children and backlog boundaries. Register the suite for required CI execution. Validation: pre-fix DragonOS failed 20 of the initial 24 tests and reproduced both nginx warnings. Final Linux and DragonOS suites pass 40/40; 71 existing guest regressions pass; five additional guest repetitions pass 200/200. Default nginx starts without the warnings and serves both IP families. Kernel build, format checks and two-round independent adversarial review passed. The implementation remains bounded per-interface slot emulation, not a complete Linux global accept queue. Each interface uses at most eight slots, approximately 2 MiB of TCP buffers per listener. Signed-off-by: longjin <longjin@dragonos.org>
Member
Author
|
@codex review |
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.
Problem
nginx calls
listen()again while configuring its backlog. DragonOS rejected every already-listening TCP socket withEINVAL, producinglisten() ... failed, ignoredwarnings for both address families even though the initial listener remained usable.Changes
Validation
make kernel,make fmt,FMT_CHECK=1 make fmtScope and limits
This remains bounded per-interface smoltcp slot emulation, not Linux's global accept queue. Each interface has at most eight slots, approximately 2 MiB of TCP buffers per listener. Aggregate queue limits and nonzero-backlog saturation behavior are not claimed to match Linux completely.
This does not resolve the separately tracked nginx concurrency, TLS response, graceful-exit, or TCP TIME_WAIT issues. Allocation-failure injection and raw half-open SYN/RST injection were not performed; completed-connection resets are covered. Remote CI will run after submission.