Skip to content

Bun.connect: native write() returns -1 (not raw -errno) on a peer RST and close carries ECONNRESET - #36422

Open
robobun wants to merge 12 commits into
mainfrom
farm/7badbb3f/native-socket-write-rst-errno
Open

Bun.connect: native write() returns -1 (not raw -errno) on a peer RST and close carries ECONNRESET#36422
robobun wants to merge 12 commits into
mainfrom
farm/7badbb3f/native-socket-write-rst-errno

tighten on_end comment

e9aee11
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 30, 2026 in 27m 57s

Code review found 2 important issues

Found 1 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 2
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/runtime/socket/socket_body.rs:2972-2974 fatal_write_errno latching bypasses the Windows quarantine of unverified fatal-write detection

Annotations

Check failure on line 2974 in src/runtime/socket/socket_body.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

fatal_write_errno latching bypasses the Windows quarantine of unverified fatal-write detection

The new `fatal_write_errno` latching at :2462-2464 and here bypasses the Windows quarantine of unverified fatal-write detection: `on_writable` at :909/:928 explicitly discards this signal on Windows (per the a5e7ba5905 / test-http-no-content-length regression, documented at :891-898 and :2934-2937), but the new ungated `.set()` records it anyway, and the ungated consumers at :1592 (suppress `end` + force-close) and :2070 (inject `syscall:'write'` error) act on it. On Windows a WSA error that `wr