Skip to content

fix: honor the polling interval while the live command result file is missing - #768

Open
pcbeingused333 wants to merge 1 commit into
QuantConnect:masterfrom
pcbeingused333:fix/read-from-file-poll-interval
Open

pcbeingused333 wants to merge 1 commit into
QuantConnect:masterfrom
pcbeingused333:fix/read-from-file-poll-interval

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #748

DockerManager.read_from_file only slept inside its exception handlers. When the result file does not exist yet, cat exits nonzero with empty stdout, but Popen does not raise, so the loop skipped the sleep and re-ran docker exec back to back until the timeout.

Sleep for the configured interval after an empty read. A result that is already available still returns immediately, without sleeping.

Testing and validation

Two tests in tests/components/docker/test_docker_manager.py: one asserts the interval is slept while the result file is empty (fails before the change, passes after) and one asserts a ready result returns without sleeping. The whole file passes (21 tests).

This change was prepared with assistance from Claude (Anthropic).

… missing

read_from_file only slept in its exception handlers, but a missing result file makes cat exit nonzero with empty stdout without raising, so the loop re-ran docker exec back to back until the timeout. Sleep for the interval after an empty read.
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 command result polling ignores its interval while the result file is absent

1 participant