Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(image-loading): mitigate tar load problem #881

Merged
merged 2 commits into from
Dec 8, 2021

Conversation

sbaier1
Copy link
Contributor

@sbaier1 sbaier1 commented Dec 8, 2021

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 arguments

For 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)

@iwilltry42 iwilltry42 added this to the v5.2.2 milestone Dec 8, 2021
@iwilltry42 iwilltry42 merged commit 43e9f9e into k3d-io:main Dec 8, 2021
Copy link
Member

@iwilltry42 iwilltry42 left a comment

Choose a reason for hiding this comment

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

LGTM

@iwilltry42
Copy link
Member

I also tried to figure out what's going on here for a while, but it indeed doesn't seem to be easy to find the cause of this error.
Thanks for the quick fix! 🙏

@all-contributors please add @sbaier1 for code

@allcontributors
Copy link
Contributor

@iwilltry42

I've put up a pull request to add @sbaier1! 🎉

@sbaier1 sbaier1 deleted the fix/tar-load-error branch December 8, 2021 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] loading multiple images fails on the default mode
2 participants