Skip to content

Retry UDS drain on port exit to fix macOS CI race#5

Merged
nyo16 merged 1 commit into
masterfrom
fix/macos-port-exit-race
Apr 17, 2026
Merged

Retry UDS drain on port exit to fix macOS CI race#5
nyo16 merged 1 commit into
masterfrom
fix/macos-port-exit-race

Conversation

@nyo16
Copy link
Copy Markdown
Owner

@nyo16 nyo16 commented Apr 17, 2026

macOS runners can deliver the shepherd's Port {:exit_status} message before the UDS buffer has MSG_CHILD_EXITED readable. A single 500 ms recv then missed the payload, the status stayed :running, and 5 s later :force_exit_timeout synthesised 137 — producing the flaky {"", 137} instead of {"", 0} on echo-to-stderr fast-exit tests.

Replace the single call in maybe_read_exit_status with drain_uds_for_exit/2: retry up to 5 times (2.5 s worst case) on :no_message, stop immediately on :closed (shepherd died without sending) or unexpected frames, and call finish_exit on success. Still well under the 5 s force timeout fallback.

macOS runners can deliver the shepherd's Port {:exit_status} message
before the UDS buffer has MSG_CHILD_EXITED readable. A single 500 ms
recv then missed the payload, the status stayed :running, and 5 s
later :force_exit_timeout synthesised 137 — producing the flaky
{"", 137} instead of {"", 0} on echo-to-stderr fast-exit tests.

Replace the single call in maybe_read_exit_status with
drain_uds_for_exit/2: retry up to 5 times (2.5 s worst case) on
:no_message, stop immediately on :closed (shepherd died without
sending) or unexpected frames, and call finish_exit on success.
Still well under the 5 s force timeout fallback.
@nyo16 nyo16 merged commit 6b2abc0 into master Apr 17, 2026
8 of 9 checks passed
@nyo16 nyo16 deleted the fix/macos-port-exit-race branch April 17, 2026 16:15
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