ReviewOS

home-lang/home

Bun parity: implement Windows half-close lifecycle for net and HTTP

#436
Open chris opened this 9 days ago ·
9 days ago

Tracks genuine Windows failures from #66: test-net-pingpong and HTTP write-after-socket.end teardown.\n\nAcceptance criteria:\n- make native sockets internally half-open and let JavaScript Duplex ownership decide closure\n- use shutdown rather than immediate close for endNT\n- propagate server allowHalfOpen and highWaterMark to accepted sockets\n- make plain Windows named-pipe shutdown end only the writer\n- allow the accepted side to write its final response after peer FIN\n- release mid-upload reset connections so server close and async disposal complete\n- add direct awaited Windows tests, including repeated ping-pong cycles and the 10 MiB upload teardown\n\nParent tracker: #66

9 days ago

Implementation is complete locally in b1fcb36 (push queued by github.com DNS failure). Native TCP, fd, and named-pipe transports stay internally half-open while the JS Duplex layer controls public allowHalfOpen behavior. Named-pipe EOF emits end once without killing the writer, and reset uses terminate. Failed pre-open pipes now close/destroy their raw uv.Pipe exactly once without re-entering detached socket handlers or leaking refs. Focused lifecycle tests pass; native Windows stress validation remains.

Sign in to comment on this issue.