Skip to content

fix(docker): stop waiting for a result file when the container is not running - #794

Open
pcbeingused33 wants to merge 1 commit into
QuantConnect:masterfrom
pcbeingused33:fix/read-from-file-stopped-container
Open

pcbeingused33 wants to merge 1 commit into
QuantConnect:masterfrom
pcbeingused33:fix/read-from-file-stopped-container

Conversation

@pcbeingused33

Copy link
Copy Markdown
Contributor

Fixes #786

Root cause: DockerManager.read_from_file only set container-running to false when get_container_by_name returned None. That lookup uses containers.list(all=True), so a container that has already exited still counted as alive and the loop kept polling until the timeout. write_to_file already rejects containers whose status is not running.

Fix: read_from_file now applies the same check: if the container exists but is not running, it returns immediately with container-running: false and a "is not running" error.

Tests: new test in tests/components/docker/test_docker_manager.py with an exited container; it fails before the change (the loop tries to read the file) and passes after. tests/components/docker and tests/commands/live pass.

This change was prepared with AI assistance.

… running

read_from_file only reported container-running=false when the container did not exist at all. get_container_by_name lists all containers, so an exited one kept counting as alive and the loop waited out the whole timeout. Check the status like write_to_file already does.
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.

Live result polling reports an exited container as still running

1 participant