fix(docker): remove POSIX shell cleanup commands from DockerEnvironment.cleanup - #29189
Closed
soynchux wants to merge 1 commit into
Closed
fix(docker): remove POSIX shell cleanup commands from DockerEnvironment.cleanup#29189soynchux wants to merge 1 commit into
soynchux wants to merge 1 commit into
Conversation
This was referenced May 22, 2026
Contributor
|
This looks implemented on current main by a later Docker cleanup fix. Automated hermes-sweeper review evidence:
Thanks for the cleanup hardening PR; the same core issue is now covered on main. |
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.
Summary
Fix Docker environment cleanup so it no longer depends on POSIX shell syntax or shell interpolation.
DockerEnvironment.cleanup()previously launched cleanup withshell=Trueand command strings usingtimeout,sleep, background&, and shell redirects. That is fragile on native Windows shells and also breaks when the resolved Docker executable path contains spaces, such as Docker Desktop install paths.This PR changes cleanup to use argv-based
subprocess.run(...)calls from daemon threads, preserving the existing non-blocking behavior while avoiding shell parsing entirely.Changes
docker stopnon-blocking by running it in a daemon thread.docker stopfails or times out, force-remove the container withdocker rm -f.docker rm -fwithout shellsleep.Why
This improves cross-platform reliability and removes shell quoting risk in container cleanup. It is especially relevant for native Windows support and Docker Desktop paths where the Docker binary may live under a directory such as
C:\Program Files\....Testing