Repository navigation
fix: bound Docker result reads by the live polling timeout - #793
Open
yutianjiang39 wants to merge 4 commits into
Open
yutianjiang39 wants to merge 4 commits into
yutianjiang39 wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #785. A local
lean livecommand could hang past its result timeout ifdocker execkept stdout open.DockerManager.read_from_filenow passes the time left on the polling deadline tocommunicate(). If that wait expires, it kills and reaps the local Docker CLI process, discards any late output, and returns the existing timeout message with the file name anddocker logscommand.A result that's ready immediately still returns without sleeping. The deadline bounds the wait for
docker exec; it doesn't change container lookup or the retry interval. The function signature and result dictionary stay the same. This PR is limited to the result read inread_from_file; refactoring the existing error handlers or changing other subprocess calls is out of scope.Tests
Both cases in
test_read_from_file_times_out_waiting_for_docker_execfailed on the baseline because it accepted a late success. Both pass with the patch. They check the remaining timeout after a retry and process startup, including when no time is left, and verify that cleanup happens before the method returns the timeout diagnostic.All 28 tests in
tests/components/docker/test_docker_manager.pypass with the patch, including immediate reads, empty-file retries, and filenames with shell metacharacters.