[miniflare] Close WebSocket servers during dispose#13521
[miniflare] Close WebSocket servers during dispose#13521petebacondarwin wants to merge 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 46bacd0 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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
|
I've reviewed the full context. Let me verify one more thing — compare the
This is actually the correct approach. During dispose, we want immediate teardown. The change is clean, correct, and well-placed:
LGTM |
|
✅ All changesets look good Summary of reviewed changesets:
All changesets:
|
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: |
|
Superseded by #13515 which includes this fix (closing |
The
#liveReloadServerand#webSocketServer(bothws.WebSocketServerinstances created withnoServer: true) were never explicitly closed duringMiniflare.dispose(). Stopping the loopback HTTP server doesn't cascade tonoServerWebSocket servers, so connected WebSocket clients (e.g., browser live reload, devtools) would keep sockets alive, preventing the Node.js event loop from draining and contributing towrangler devhanging on Ctrl-C.This PR terminates all connected WebSocket clients and closes both servers during
dispose(), placed after#stopLoopbackServer().