Skip to content

Add write-path probes for the non-blocking writer (#291) - #294

Merged
scgopi merged 1 commit into
mainfrom
test/291-write-path-probes
Sep 6, 2026
Merged

scgopi merged 1 commit into
mainfrom
test/291-write-path-probes

Conversation

@scgopi

@scgopi scgopi commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Test-only. Lands the probe suite from the #291 re-review, for code that is already on main.

#291 replaced the channel's blocking write(2) with non-blocking send plus a bounded poll, because a thread parked inside a blocking write on a unix socket is not reliably woken by another thread's shutdown — which had closeAndWait hanging the full test suite. That write path merged with only its own tests plus the reviewer's earlier probes; these are the ones written specifically to attack it.

What they cover:

  • Partial writes. A frame pushed through a 2 KB buffer at 13 sizes from 1 B to 300 KB arrives intact and unduplicated — the loop advances its pointer correctly across many short writes.
  • Close landing mid-frame. The stream ends at EOF rather than with a truncated or garbled frame, so a reader never sees half a message as if it were whole.
  • A peer vanishing while the writer is parked. Noticed within one 50 ms poll slice rather than hanging.
  • EINTR, EAGAIN, and written == 0 all take their intended branch.

Gate on this branch: 1604 tests / 165 suites / 0 failures, no restarts — the reviewer independently measured the same count.

Authored by the reviewer on review/291-probes-2, cherry-picked unchanged; I only verified it.

Related to #288, #291.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BP43ags4cn8fq2ZZdv85J9

Partial writes resuming without truncation or duplication against a 2 KB
receive buffer, a close landing mid-frame ending the stream rather than
corrupting it, and a peer that vanishes while the writer is parked being
noticed without anyone closing the channel.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BTGxgXNsZkDeiZE273zbqL
@scgopi
scgopi merged commit 2b6b600 into main Sep 6, 2026
1 check passed
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