Kill the container ourselves when done #1019
Merged
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.
We stream messages from the coordinator to the worker via stdin/stdout piped to
docker run
. However, sometimes we close the pipe corresponding todocker run
's stdout before it has had a chance to fully write everything. If that happens,docker run
exits without deleting the container 1.This has likely always been a problem with the coordinator / worker architecture, but it's exacerbated by the recent addition of the memory / CPU status messages that occur every second, which greatly increase the amount of data crossing the boundary.
This reorganizes the code to pass in a known reasonably unique name to the container and then attempts to kill that container at cleanup time.
I tested by:
loop { println!("moo"); }
)This reliably recreated the
write /dev/stdout: broken pipe
error from thedocker run
invocation, but after this commit there were no vestigial running containers.