Clean up containers on graceful shutdown - #7244
Open
ghostwriternr wants to merge 1 commit into
Open
Conversation
ghostwriternr
force-pushed
the
fix/container-sidecar-shutdown
branch
3 times, most recently
from
September 4, 2026 11:11
e5fb9de to
7252c38
Compare
workerd can leave application and sidecar containers behind after SIGTERM because Docker cleanup starts after network I/O is torn down. Start cleanup after requests drain, while Docker I/O remains available. Stop container-enabled actors first so they cannot recreate containers during cleanup, and cover the SIGTERM path with a process-level test. This affects only local development. Production Durable Object containers do not use workerd's local Docker engine.
ghostwriternr
force-pushed
the
fix/container-sidecar-shutdown
branch
from
September 4, 2026 11:29
7252c38 to
11500b4
Compare
jasnell
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
workerd previously left application and sidecar containers behind after SIGTERM because Docker cleanup started too late, after network I/O was already being torn down.
This is a local-dev bug only. Production Durable Object containers are not created through workerd's local Docker engine.
This change ensures cleanup starts after request drain, while Docker I/O is still available. Stop container-enabled actors first so they cannot recreate containers during that cleanup. Cover the SIGTERM path with a process-level test.
The new test is tagged requires-container-engine, so default CI will skip it, matching other Docker tests.