Skip to content

Honor the polling interval while a live command's result file is absent - #781

Merged
quantconnect-kronos[bot] merged 1 commit into
masterfrom
kronos/bug-748-result-polling-interval
Nov 23, 2026
Merged

quantconnect-kronos[bot] merged 1 commit into
masterfrom
kronos/bug-748-result-polling-interval

Conversation

@quantconnect-kronos

Copy link
Copy Markdown
Contributor

Closes #748

DockerManager.read_from_file slept only in its exception handlers. A result file that doesn't exist yet makes cat exit nonzero with empty output, which doesn't raise, so the loop launched docker exec again right away until the timeout. It now sleeps for interval after an empty read. A result that is already there still returns at once, with no sleep.

The commit is cherry-picked from #768 by @pcbeingused333, with authorship kept.

Testing

  • New tests in tests/components/docker/test_docker_manager.py: an empty read sleeps for the interval (fails on master), and a ready result returns without sleeping.
  • Full suite python -m pytest -q -rs: 2913 passed, 81 skipped.
  • Tested end to end against a real running container, with read_from_file(..., interval=1, timeout=4):
    • missing file: 4 docker exec calls over 4.8s (master: 24 calls over 4.2s)
    • existing file holding {"Success": true}: success after 1 call in 0.19s (same as master)

… 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.
@quantconnect-kronos quantconnect-kronos Bot added kronos:develop:working develop: in progress kronos:review Request review labels Nov 23, 2026
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added kronos:review:queued review: queued kronos:review:working review: in progress and removed kronos:review Request review kronos:review:queued review: queued labels Nov 23, 2026

@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, risk:low: the change adds one line, is easy to revert, and the new test fails on master and passes with the fix. CI is green.

A missing result file now waits interval between docker exec attempts. A result that is already there still returns on the first read. The only cost is that the last empty read can run past timeout by up to one interval. That is 1s against the 30s timeout lean live commands use, which is fine.

@quantconnect-kronos-reviewer
quantconnect-kronos-reviewer Bot marked this pull request as ready for review November 23, 2026 15:53
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot removed the kronos:review:working review: in progress label Nov 23, 2026
@quantconnect-kronos quantconnect-kronos Bot added the kronos:review Request review label Nov 23, 2026
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added kronos:review:queued review: queued and removed kronos:review Request review labels Nov 23, 2026
@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot added kronos:review:working review: in progress and removed kronos:review:queued review: queued labels Nov 23, 2026

@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. No blocking regression found.

Independent verification:

  • Full local suite: 2,913 passed, 81 skipped. The new missing-file regression test fails against master; the ready-result test passes on both.
  • Tested end to end: a missing file produced 4 Docker reads in 4.68s, versus 23 in 4.12s on master, with at least one second between retries. A ready result returned after one read in 0.17s on both. The live-command result caller also successfully picked up a result created after polling started.

The final sleep can extend the wait by one interval, consistent with the existing retry paths; callers use a one-second interval and a 30-second timeout. Separate baseline defects reproduced on both versions are tracked in #783–#786 and do not block this fix.

@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot removed the kronos:review:working review: in progress label Nov 23, 2026
@quantconnect-kronos
quantconnect-kronos Bot merged commit bf0e8f7 into master Nov 23, 2026
60 checks passed
@quantconnect-kronos
quantconnect-kronos Bot deleted the kronos/bug-748-result-polling-interval branch November 23, 2026 16:06
@quantconnect-kronos quantconnect-kronos Bot removed the kronos:develop:working develop: in progress label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Low risk

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