deno
fe040fc0 - fix(ext/node): retry named-pipe connect on ERROR_PIPE_BUSY (Windows) (#33974)

Commit
41 days ago
fix(ext/node): retry named-pipe connect on ERROR_PIPE_BUSY (Windows) (#33974) On Windows, when all of a named-pipe server's instances are in use (e.g. Docker Desktop under load from testcontainers spinning up containers), `CreateFileW` returns `ERROR_PIPE_BUSY` (231). libuv handles this transparently by queueing the connect to a worker thread that calls `WaitNamedPipeW` and retries — node code like `docker-modem` relies on this. In Deno today the same condition surfaces to JavaScript as `Error: connect EINVAL //./pipe/docker_engine`, which is the intermittent failure reported in the linked issue. The fix mirrors libuv's `pipe_connect_thread_proc`: when the synchronous `ClientOptions::open()` in `uv_pipe_connect` returns 231, spawn a blocking task that loops on `WaitNamedPipeW(30s)` + retry until an instance becomes available, and fire the deferred connect callback with the resolved status once the worker completes. Also cleans up a dead branch in `io_error_to_uv` that claimed `ERROR_PIPE_BUSY` mapped to `PermissionDenied` in Rust std (it actually maps to `Uncategorized`, so the check was unreachable), and adds explicit raw-os-error mappings for the common Win32 pipe codes so they no longer fall through to `UV_EINVAL`. Fixes #33923
Author
Parents
Loading