Repository navigation
feat(daemon): macOS kqueue accept engine with blocking fallback - #6217
Merged
Merged
Conversation
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
oferchen
added a commit
that referenced
this pull request
Sep 8, 2026
…#7745) The eleven docs that cite SIGNAL_CHECK_INTERVAL were line-accurate when written, but the code moved twice since: PR #5908 lowered the single-listener WouldBlock sleep from 500ms to 50ms and deleted the constant, and PR #7681 replaced accept-side sleep-polling with a readiness wait (poll(2) in PollAcceptEngine, kevent(2) behind the opt-in macos-kqueue feature in KqueueAcceptEngine) in server_runtime/accept_engine.rs. Bring the living documents back in line with the tree: - kqueue-pipeline-audit: mark the two daemon-accept surface rows migrated (KQ-S.1 landed via #6217/#7681) instead of describing the deleted sleep-poll loops as the current implementation. - daemon-tpc-benchmark-plan: bound SIGTERM-to-drain latency by the accept engine's 50ms/100ms signal-check cadence, and mark tracker #1683 completed. - daemon-event-loop-multiplexing: add a status note to the follow-up list and tick #1683, which #5908/#7681 closed. - daemon-thread-per-connection-scalability: mark tracker #1683 completed in the references list. - dis-4a, dis-3, daemon-coldstart-profile, daemon-coldstart-rebench: record that DIS-4.a R1 has since landed, next to the sections that rank it as the top open bottleneck; retarget the DIS-2 file index entry that still pointed the constant at listener.rs. The audit bodies keep their historical line citations: they describe the tree that was measured. daemon-thread-per-connection.md, async-daemon-listener.md (pinned 'Last verified: 2026-05-01'), and daemon-async-listener-rfc.md are left untouched as dated snapshots.
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.
Task #457 (NACC-5). Adds a macOS
kqueue/EVFILT_READdaemon accept engine behind the existingAcceptEnginetrait (NACC-3), replacing a blockingaccept()/sleep-poll on macOS with event-driven wait. Additive (+339/-4): the Single/Multi-listener engines are byte-identical; the only removed lines are amut listeners→listenerssignature tweak.KqueueAcceptEnginereuses the existingfast_io::KqueueLoopsafe wrapper (no new daemon FFI), registers all N listener fds (EVFILT_READ|EV_CLEAR, edge-triggered), and onpoll()drain-accept()s a ready listener untilWouldBlock(prevents dropped connections on a burst), resets accepted sockets to blocking, buffers surplus, returns one per poll.build_accept_enginefalls through to the existing single/multi engine. Accept never breaks.waitgives the shared loop the same signal-check cadence as the dual-stack engine;shutdown()idempotent.--max-connectionsadmission + N-listener handling live in the shared loop body, untouched.Verified on macOS aarch64 — real kqueue accept exercised:
kqueue_engine4 tests pass (client accept + blocking-reset via EVFILT_READ, Idle-parks-~100ms not busy-spin, 3-conn burst drained behind one notification, idempotent shutdown); fullcargo test -p daemon --all-features22 passed/9 ignored; clippy-D warnings, fmt,cargo docgate all clean. Linux + blocking engines unchanged.