Live result polling reports an exited container as still running

Đang mở Phù hợp với người mới
#786 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/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, python
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu trong lean/components/docker/docker_manager.py tại read_from_file và get_containers_by_name; so sánh trạng thái container từ containers.list(all=True) với kiểm tra hiện tại chỉ dựa trên sự tồn tại. Tái hiện với một container Bash đã dừng, không có --rm, và read_from_file(..., interval=0.01, timeout=0.25), sau đó xác nhận lean/commands/live/live.py:get_result vẫn nhận đúng flag. Hoàn thành nghĩa là một container đã dừng đã đăng ký trả về container-running=false ngay lập tức, trong khi các container đang chạy vẫn poll và các container bị thiếu hành xử như trước.

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

Mô tả

priority:P2

Problem

DockerManager.read_from_file sets container-running=false only when the container no longer exists. get_container_by_name searches stopped containers too, so an exited container is treated as running, and failed execs are retried until the result timeout.

Reproduction and evidence

  1. Start a disposable Bash container without --rm, then stop it so it remains registered in Docker.
  2. Call read_from_file(container_name, Path('/tmp/absent.json'), interval=0.01, timeout=0.25).

On current master, the call returns success=false, a result-file timeout error, and container-running=true, while Docker reports the container's status as exited.

Relevant code: lean/components/docker/docker_manager.py, the container check in read_from_file and containers.list(all=True) in get_containers_by_name. lean/commands/live/live.py:get_result relies on the returned flag to report whether the container is running.

Required result

A registered but stopped container must be reported as not running promptly rather than being described as a running container whose result file timed out. Preserve polling for running containers and the existing handling of missing containers.

Ngôn ngữ chính
Python
Star
335
Fork
172
Merge trung bình
6 giờ 54 phút
Pull request đã merge (30 ngày)
37

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 QuantConnect/lean-cli

Tất cả issue của QuantConnect/lean-cli

Issue tương tự

Thêm issue về Python

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.