Skip to content

fix: close two workspace-delete volume leaks - #1112

Draft
skevetter wants to merge 7 commits into
mainfrom
humane-otter
Draft

fix: close two workspace-delete volume leaks#1112
skevetter wants to merge 7 commits into
mainfrom
humane-otter

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Problem

devsy workspace delete leaks docker volumes in two independent ways:

  1. DockerHelper.Remove runs docker rm without -v, so any anonymous volume attached to the container (image VOLUME directives, unnamed devcontainer.json mounts) survives.
  2. cleanupDeliveryVolume logs cleanup failures at Debug level, so a failed volume removal is indistinguishable from success unless --debug was already on.

A third suspected leak (imported/attached-container workspaces never cleaning up the agent volume) was investigated and ruled out: that volume is only ever created for newly-created containers (via resolveNewContainer's pre-start delivery), never for imported ones (which use shell-based legacyInject instead), so there is nothing to leak there.

Fix

  1. docker rm -v in pkg/docker/helper.go.
  2. Cleanup failures now log at Warn.

Tests

Each fix has a dedicated test written first against the pre-fix code to confirm it reproduces the issue, then passing after the fix:

  • e2e/tests/down/down.go (workspace delete removes anonymous volumes declared by the image)
  • pkg/devcontainer/delete_test.go (TestCleanupDeliveryVolume_LogsWarningOnFailure)

Verification note

This sandbox has no docker daemon available, so the new e2e spec could only be verified by compilation (go build/go vet clean) and static review against existing e2e conventions (e2e/tests/down, e2e/tests/up), not by an actual RED→GREEN run. The pkg/docker and pkg/devcontainer unit test suites (no real daemon required) all pass, including the new TestCleanupDeliveryVolume_LogsWarningOnFailure. Please confirm the e2e spec flips from failing to passing with fix #1 in an environment with docker before merging.

@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 561b49d
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a87e98af897ed000802e27e

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f41f939-a2bc-439a-9c87-eb8a3f23980c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 561b49d
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a87e98a88ea960008fd2247

@github-actions

Copy link
Copy Markdown

⚠️ This PR contains unsigned commits. To get your PR merged, please sign those commits (git rebase --exec 'git commit -S --amend --no-edit -n' @{upstream}) and force push them to this branch (git push --force-with-lease).

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with gpg:

  1. Generate a GPG key
  2. Add the GPG key to your GitHub account
  3. Configure git to use your GPG key for commit signing
Sign commits with ssh-agent

Follow the steps below to set up commit signing with ssh-agent:

  1. Generate an SSH key and add it to ssh-agent
  2. Add the SSH key to your GitHub account
  3. Configure git to use your SSH key for commit signing
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process.

Learn how to use 1Password to sign your commits.

Watch the demo

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 8 complexity · 3 duplication

Metric Results
Complexity 8
Duplication 3

View in Codacy

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.

Run reviewer

TIP This summary will be updated as you push new changes.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant