cloudflare / cloudflare/workers-sdk
miniflare: old Pool not closed when runtime entry URL changes
Open
package:miniflare
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.5k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 186
Description
When `previousEntryURL` differs from the new `#runtimeEntryURL` at packages/miniflare/src/index.ts:2143-2150, a new Pool is assigned to `this.#runtimeDispatcher` without first closing/destroying the previous Pool instance. This is a minor resource leak — the old Pool's connections will eventually time out, but it would be cleaner to explicitly close it. The `dispose()` method at line 2791 also doesn't explicitly close the dispatcher, though workerd shutting down implicitly terminates the connections.
Contributor guide
Assessment
This issue has not been assessed yet.