deno
1ececcbc - fix(core): fix uv_pipe_open handle lifecycle to match libuv (#33225)

Commit
113 days ago
fix(core): fix uv_pipe_open handle lifecycle to match libuv (#33225) ## Summary Fix pipe handle lifecycle to match libuv's semantics. Two changes: 1. **Don't set `UV_HANDLE_ACTIVE` in `uv_pipe_open`** -- In libuv, `uv_pipe_open` only associates an fd with the handle. The handle becomes active only when `uv_read_start` or `uv_write` is called. Setting ACTIVE eagerly prevents the event loop from exiting when the pipe is idle (e.g. `process.stdout` opened as a pipe with no pending I/O). 2. **Deactivate pipe handles when idle** in `poll_pipe_handle` -- After each poll cycle, check if the handle has any pending work (reads, writes, connects, listens, shutdowns). If not, clear `UV_HANDLE_ACTIVE` so the event loop's `is_alive` check doesn't consider it active. This matches libuv where a handle is only "active" while it has outstanding operations. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Parents
Loading