fix(image-loading): mitigate tar load problem #881
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.
What
Closes #878
Fixes the problem by separately loading tars one by one when loading with streams instead of concatenating.
Why
To be honest, at this point i'm not exactly sure but from my debugging it seems like some EOF marker in the tar causes
ctr
to stop reading and exit, causing the exec stream to close and the load to error out when multiple tar files are passed in the argumentsFor some reason this doesn't happen with streams from the docker engine (possibly because it properly concatenates the tar streams but this seems like pretty low-level stuff)
Implications
It might have some minor performance impact, but it doesn't seem to make much of a difference in my quick tests. (starting docker exec streams seems pretty cheap)