[miniflare] Fix resource leaks during config updates#13586
[miniflare] Fix resource leaks during config updates#13586petebacondarwin merged 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: dc5a137 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 |
Changeset ReviewFile Reviewed
Summary✅ All changesets look good DetailsThe changeset for miniflare is well-written:
|
|
I've now reviewed all the changed files thoroughly. Let me analyze the changes: Change 1: Change 2: Both changes are correct, straightforward, and well-scoped. The changeset is appropriate. I don't see any logic bugs, race conditions, or backward compatibility issues:
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: |
0164dfa to
dc5a137
Compare
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Fixes #13584, #13585.
Follow-up to #13515 addressing two resource-cleanup issues identified during review:
devRegistryDispatcher unconditionally closed on every config update (#13584):
The
#devRegistryDispatcherwas torn down and rebuilt on every#assembleAndUpdateConfig()call, regardless of whether the port changed. This is inconsistent with#runtimeDispatcher(which only recreates when the entry URL changes) and could cause brief request failures if#pushRegistryUpdate()is in-flight when the pool is closed. Fixed by tracking the port and only closing/recreating when it actually changes.Old InspectorProxy instances not disposed during updateConnection (#13585):
InspectorProxyController.updateConnection()replacedthis.#proxieswith newInspectorProxyinstances without first disposing the old ones. This leaked runtime WebSocket connections and their 10-second keepalive interval timers. Fixed by disposing old proxies before replacement.