-
Notifications
You must be signed in to change notification settings - Fork 1k
cleanup containers directly instead of using process.exit hook #10986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 13e2816 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 |
|
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this, therefore, rely upon the teardown being called on (effectively) process exit?
2df5f63 to
b59adfb
Compare
| #teardown = async (): Promise<void> => { | ||
| logger.debug("MultiworkerRuntimeController teardown beginning..."); | ||
|
|
||
| this.cleanupContainers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed since the public teardown() method calls super, which will run the cleanup already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| }, WAITFOR_OPTIONS); | ||
|
|
||
| wrangler.pty.kill("SIGINT"); | ||
| // ctrl + c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weirdly sending a sigint to the wrangler process in interactive-dev-tests was always cleaning up wrangler containers (so we didn't catch the regression), but writing ctrl+c does fail without the changes in this pr
Wrangler dev regressed a bit and stopped removing containers on exit after #10862.
This PR also adds a direct call to cleanupContainers in the teardown hook.
I think removing and re adding event listeners in onBundleStart should still stop the tests flaking still.
We can't remove the process.exit hooks entirely, since if we don't manage to call teardown (e.g. when something like concurrently is killing wrangler), we won't cleanup containers.