Detect early workerd exit instead of hanging indefinitely#14081
Detect early workerd exit instead of hanging indefinitely#14081dario-piotrowicz wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 573eafc The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
✅ All changesets look good |
|
UnknownError: ProviderInitError |
|
@dario-piotrowicz Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
Now I have a thorough understanding of the changes. Let me analyze: The core change (in
Let me think about potential issues:
The changes look correct, well-tested, and solve a real problem. The approach is sound. LGTM |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
When
workerdexits during startup before writing all expected listen events to the control file descriptor (e.g. due to an IPv6 bind failure, permission error, or missing library), Miniflare'swaitForPorts()would block forever. This causedwrangler devto stall at "Starting local server..." with no error and no timeout.The fix races
waitForPorts()against the child process exit event so that any unexpectedworkerdtermination is detected immediately. Whenworkerdexits early, Miniflare now throwsERR_RUNTIME_FAILUREwith the runtime's stderr output included in the error message, making the root cause diagnosable without external tools.Important
I've created this PR as an attempt to address #14077, it however does not fix that issue.
But in any case this seems looks like an improvement to me that makes miniflare a bit more robust (and it could potentially save some user some pain?)... although it might be completely unnecessary... I'll leave this to the discretion of the reviewer.... I am totally ok proceeding with this PR or scrapping it entirely
A picture of a cute animal (not mandatory, but encouraged)