Skip to content

fix(network): bsdsocket review follow-ups - #41

Merged
midwan merged 4 commits into
masterfrom
fix/bsdsocket-review-follow-ups
Sep 15, 2026
Merged

midwan merged 4 commits into
masterfrom
fix/bsdsocket-review-follow-ups

Conversation

@midwan

@midwan midwan commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Follow-up PR for post-merge Codex review rounds on the bsdsocket port (#39/#40). Will stay open until review rounds settle.

Current fixes

  • Stop close-only polling of datagram sockets (finding on amiberry#2334, 19:00Z): REP_CLOSE polling added datagram sockets to readfds; 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 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

  • Clean build (macOS, Apple Silicon)
  • AROS boot with socket_emu=true: no errors, clean exit

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-15T19:05:30.675525Z d36b76f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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.
@midwan
midwan merged commit 99d2696 into master Sep 15, 2026
12 checks passed
@midwan
midwan deleted the fix/bsdsocket-review-follow-ups branch September 15, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant