fix(network): bsdsocket review follow-ups - #41
Merged
Merged
Conversation
REP_CLOSE polling added datagram sockets to readfds, but a queued datagram keeps select() readable forever with no event able to fire (REP_CLOSE never fires on datagrams, REP_READ not requested or already fired) — a permanent 10ms busy-poll. Datagram sockets have no EOF; their readfds entry comes from the REP_READ gate, so close-only polling is now stream-only.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…RITE on datagrams - REP_ACCEPT fired for any readable socket whose mask contained it (e.g. REP_ALL), sending datagram and connected sockets down an invalid accept path. accept-ready is now tracked via SO_ACCEPTCONN at registration and both the readfds gate and the event handler require it — this also stops the spurious REP_ACCEPT a connected TCP socket with REP_ALL previously got on incoming data. - host_setsockopt force-adds REP_WRITE to REP_CONNECT requests (dynAMIte implicit-writability workaround). On an unconnected datagram socket that forced bit fired an unrequested write notification; the force is now stream-only.
REP_ACCEPT gating snapshots SO_ACCEPTCONN at registration, so a server arming SO_EVENTMASK before listen() never reported accept-ready: host_listen() now updates the monitor entry on success, and listen-before-mask orderings query live state at registration anyway.
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.
Follow-up PR for post-merge Codex review rounds on the bsdsocket port (#39/#40). Will stay open until review rounds settle.
Current fixes
readfds; a queued datagram keepsselect()readable forever with no event able to fire (REP_CLOSE never fires on datagrams; REP_READ not requested or already fired) — a permanent 10 ms busy-poll. Datagram sockets have no EOF semantics, so close-only polling is now stream-only (entry.connected && !entry.dgram). Datagram readfds still come from the REP_READ gate, including zero-length datagram handling.Mirrors the same commit in amiberry#2334.
Verification
socket_emu=true: no errors, clean exit