-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Miniflare] mf.dispose()
should internally await mf.ready
#4363
Closed
Labels
miniflare
Relating to Miniflare
Comments
mrbbot
referenced
this issue
in cloudflare/miniflare
Oct 5, 2023
We previously waited for Miniflare to be ready before `dispose()`ing. Unfortunately, we weren't waiting for the `workerd` config to finish being written to stdin. Calling `dispose()` immediately after `new Miniflare()` would stop waiting for socket ports to be reported, and kill the `workerd` process while data was still being written. This threw an unhandled `EPIPE` error. This changes makes sure we don't report that Miniflare is ready until after the config is fully-written. Closes #680
mrbbot
referenced
this issue
in cloudflare/miniflare
Oct 5, 2023
We previously waited for Miniflare to be ready before `dispose()`ing. Unfortunately, we weren't waiting for the `workerd` config to finish being written to stdin. Calling `dispose()` immediately after `new Miniflare()` would stop waiting for socket ports to be reported, and kill the `workerd` process while data was still being written. This threw an unhandled `EPIPE` error. This changes makes sure we don't report that Miniflare is ready until after the config is fully-written. Closes #680
This is essentially fixed in cloudflare/miniflare#705 but I noticed my workaround to |
mrbbot
changed the title
[Miniflare] Nov 7, 2023
mf.dispose()
should internally await mf.readymf.dispose()
should internally await mf.ready
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Calling
mf.dispose()
before themf.ready
promise has resolved causes this error:Repro:
Workaround:
Ideally, the dispose method would internally await the ready promise
The text was updated successfully, but these errors were encountered: