Skip to content

[miniflare] Await workerd exit before local container cleanup - #15595

Draft
ghostwriternr wants to merge 1 commit into
cloudflare:mainfrom
ghostwriternr:fix/local-container-sidecar-cleanup
Draft

ghostwriternr wants to merge 1 commit into
cloudflare:mainfrom
ghostwriternr:fix/local-container-sidecar-cleanup

Conversation

@ghostwriternr

Copy link
Copy Markdown
Member

Miniflare currently force-kills workerd on dispose. That is the right default for ordinary Workers, because Chrome can keep HTTP connections open for about 10s. For Durable Object containers it is wrong: workerd owns the application container and the proxy-everything sidecar, and it can remove them only while its Docker connection is still alive.

This sends SIGTERM when the serialized workerd config includes a Durable Object container, waits for the process to exit, and falls back to SIGKILL after five seconds. Wrangler and the Vite plugin now dispose Miniflare before deleting containers by their prepared image tags.

Do not merge until workers-sdk pins a workerd release that performs that sidecar cleanup. The Docker fixture asserts that both runtime containers are gone after close; that assertion is expected to fail on the current pin.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this is local-dev shutdown behavior; there is no new config or public API.

@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: db81b9d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
miniflare Patch
@cloudflare/deploy-helpers Patch
@cloudflare/pages-shared Patch
@cloudflare/remote-bindings Patch
@cloudflare/runtime-types Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-plugin Patch
wrangler Patch

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

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Sep 10, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15595

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15595

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@15595

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15595

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@15595

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15595

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@15595

miniflare

npm i https://pkg.pr.new/miniflare@15595

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15595

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@15595

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@15595

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@15595

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@15595

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15595

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@15595

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15595

wrangler

npm i https://pkg.pr.new/wrangler@15595

commit: db81b9d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants