[miniflare] Make temp directory cleanup best-effort in dispose()#13078
[miniflare] Make temp directory cleanup best-effort in dispose()#13078
dispose()#13078Conversation
🦋 Changeset detectedLatest commit: 2e0ee78 The changes in this PR will be included in the next version bump. 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 |
|
The change is clean and correct. Let me verify my understanding:
The only minor observation is that the sync exit hook logs the error at debug level (
The changeset is properly formatted as a This is a straightforward, well-motivated fix. No logic bugs, no security issues, no backward compatibility concerns. LGTM |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
Fixes #10511.
On Windows,
workerdmay not release file handles immediately afterRuntime#dispose()returns. WhenMiniflare#dispose()then tries to remove the temp directory,fs.promises.rmfails withEBUSY— and because this isn't caught, the error propagates to the caller (e.g.vitest-pool-workers), producing noisy errors in test output.The temp directory lives in
os.tmpdir(), so the OS will clean it up eventually. This makes the async cleanup path best-effort — matching the pattern the synchronous exit hook already uses.