Repository navigation
feat: single-threaded poll reactor with graceful shutdown - #7
Merged
Merged
Conversation
…signals server::Server reactor (accept batch, deadline table -> 408, POLLOUT backpressure, drain-then-drop stop with grace cap) + server::Connection (socket + RequestParser + out buffer; protocol errors answered once best-effort then dropped). Connection stays reactor-owned; no shared state yet. app::ShutdownSignals: Linux self-pipe (pipe2, instant poll wake); Windows console-control handler sets flag and blocks until notifyStopped (a returning handler means exit-now), reactor pollCap 100ms. CMake TSAN option; CI linux-tsan job (native runner: kernel containers cannot set vm.mmap_rnd_bits TSan needs). SIGINT graceful-stop smoke added to the container gate. Traps: TSan FATALs on kernel 6.x containers (unexpected memory mapping) until vm.mmap_rnd_bits=28; accepted-socket index bug — new conns join next poll, not the live fd set; test race where stop beat accept (backlog RST != EOF) fixed by serving one request first.
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.
Reactor (R, single-thread slice): poll loop, connection state machine, 408 deadlines, POLLOUT backpressure, graceful drain. Signals per OS: Linux self-pipe, Windows console-ctrl + poll cap. Integration tests over real sockets (200/keep-alive/400/408/stop).
Gates: Windows ck.ps1 green; Linux container ASan green + new SIGINT-exit-0 smoke; TSan green locally with vm.mmap_rnd_bits=28 — CI job runs it native for that reason.