Skip to content

cleanup: move VolumeRemove to correct code path#1760

Open
lukemarsden wants to merge 3 commits into
mainfrom
fix/cleanup-dead-volume-code
Open

cleanup: move VolumeRemove to correct code path#1760
lukemarsden wants to merge 3 commits into
mainfrom
fix/cleanup-dead-volume-code

Conversation

@lukemarsden
Copy link
Copy Markdown
Collaborator

Summary

  • VolumeRemove("docker-data-{sessionID}") was running on every container stop, but CONTAINER_DOCKER_PATH is always set (dev .env + production provisioning), so docker data uses bind mounts, not named volumes. The VolumeRemove was a no-op logging a spurious warning on every stop.
  • Moved it into the else branch (no CONTAINER_DOCKER_PATH) where named volumes would actually be used.
  • Consolidated comments to make the two code paths (bind mount vs named volume) clear.

Test plan

  • Stop a session — should no longer see "Failed to remove session docker-data volume" warning in sandbox logs
  • Verify session Docker data dir still preserved with .last-active marker

🤖 Generated with Claude Code

VolumeRemove("docker-data-{sessionID}") was running on every container
stop, but when CONTAINER_DOCKER_PATH is set (always, in practice), the
docker data uses a bind mount, not a named volume. So VolumeRemove was
always a no-op that logged a spurious warning.

Move it into the else branch (no CONTAINER_DOCKER_PATH) where named
volumes are actually used, and consolidate the comments to make the
two code paths clear.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lukemarsden and others added 2 commits February 26, 2026 16:21
CONTAINER_DOCKER_PATH is set in every deployment path (docker-compose,
install.sh, for-mac provisioning). The named-volume fallback was dead,
untested code that would silently do the wrong thing if someone forgot
to set it.

- Hydra now fatals on startup if CONTAINER_DOCKER_PATH is not set
- Removed all conditional guards and named-volume fallback paths
- Removed VolumeRemove call (was always a no-op with bind mounts)
- Simplified BuildKit state setup (was also conditional, now direct)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nstant

The docker data volume was identified by matching m.Destination ==
"/var/lib/docker" — a fragile coupling between hydra_executor (creator)
and devcontainer (consumer). If either side changed the path, the other
would silently break.

Now uses DockerDataVolumePrefix ("docker-data-") constant shared by
both sides, matching on the source name prefix instead of the
destination path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant