Tear down the qBittorrent E2E stack when it fails to start

Open
#2,908 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker-compose, rust
Domain
devops, testing

Research direction

Start with DockerCompose::up in src/console/ci/compose.rs and inspect how RunningCompose handles teardown on drop and how --keep-containers is applied. Reproduce a failed docker compose up --wait --detach and check the project’s containers, networks, and volumes. Done when a failed start cleans up that project’s resources while preserving --keep-containers behavior.

Written by the indexing model from the issue text.

Description

Parent EPIC: #2392

Goal

When docker compose up fails part-way, the qBittorrent E2E runner still removes every container, network and volume of its Compose project (release resources on success, failure and drop paths).

Background

Found in the review of the shared-resource audit (#2394, finding C9). DockerCompose::up (src/console/ci/compose.rs) runs docker compose up --wait --detach and returns the RunningCompose guard, whose drop runs docker compose down --volumes, only when the command succeeds. On failure it returns an error and no guard, so the containers, network and volumes already created stay on the Docker daemon, still running.

The project name and host ports are unique per run, so a leaked stack does not collide with another run; it accumulates. On the self-hosted runner each failed run leaves running containers (tracker, qBittorrent seeder and leecher, and MySQL or PostgreSQL) that hold memory and disk until someone removes them. The runner's prune script removes stopped resources, not running containers.

The plain E2E runner does not have this problem: its container guard removes the container by name, also after a failed docker run.

Approach

Run docker compose down --volumes for the project when up fails, or create the guard before up so its drop covers the failure path. Keep the --keep-containers behavior.

Tasks

  • Reproduce a failed start that leaves the stack running.
  • Tear the stack down on the failure path.
  • Recheck: a failed start leaves no containers, networks or volumes of its project.

The full specification is added to docs/issues/open/ by a spec-only pull request.

Dominant language
Rust
Stars
532
Forks
56
Avg merge
11h 20m
Merged PRs (30d)
282

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from torrust/torrust-tracker

All issues in torrust/torrust-tracker

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.