Repository navigation
fix(docker): stop running container before removing it in DeleteDevContainer - #1100
Conversation
…ntainer podman/docker refuse to `rm` a running container. The Apple and microsandbox drivers already stop before removing; the docker driver skipped this, so a workspace left running after an aborted tunnel (e.g. a killed exec session) failed to delete and leaked, cascading into resource contention and cascading timeouts in up-provider-podman-rootful-features CI runs. Mirrors the Apple driver's forgiving pattern: a stop failure is logged but removal is still attempted.
✅ Deploy Preview for devsydev canceled.
|
✅ Deploy Preview for images-devsy-sh canceled.
|
|
Warning Review limit reached
Next review available in: 38 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 1 critical |
🟢 Metrics 0 complexity · 0 duplication
Metric Results Complexity 0 Duplication 0
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
Root cause
CI job
up-provider-podman-rootful-features (rootful)failed (run 32075302649):DeferCleanupcalledworkspace delete→dockerDriver.DeleteDevContainer, which calledpodman rm <id>directly, without stopping the container first. The container was still running (only the exec session into it had died), sopodman rm(non-force) refused with "container is running" and cleanup failed.sudo podman psin the next spec) then slowed dramatically under the resulting contention, blowing through spec timeouts, and the whole test binary eventually panicked withtest timed out after 10m0s.pkg/driver/docker/lifecycle.go'sDeleteDevContainerwas the only driver skipping stop-before-remove — bothpkg/driver/apple/lifecycle.goandpkg/driver/microsandbox/microsandbox.goalready stop a running container before removing it.Fix
DeleteDevContainernow stops a running container before removing it, mirroring the Apple driver's pattern: a stop failure is logged but removal is still attempted.Verification
TestDeleteDevContainer_StopsRunningContainerBeforeRemove, which fails against the pre-fix code with the exact error class seen in CI (cannot remove running container) and passes with the fix.go build ./...andgo test ./pkg/driver/docker/...pass.golangci-lint run ./pkg/driver/docker/...clean (pre-existing, unrelatedcyclopfinding inrunPreflightuntouched).