Tear down the qBittorrent E2E stack when it fails to start

Đang mở
#2,908 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker-compose, rust
Lĩnh vực
devops, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
532
Fork
56
Merge trung bình
11 giờ 20 phút
Pull request đã merge (30 ngày)
282

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của torrust/torrust-tracker

Tất cả issue của torrust/torrust-tracker

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.