fix: retrying for big layers by waiting for the writer lock #57
+3
−3
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: #45
Related PR: #54
Use
content.OpenWriterto wait until the reference is unlocked when creating a containerd content store writer.The following error in unregistry was only possible when unregistry tried to create a new blob writer with the blow writer ID that was previously created:
And this is possible only when the distribution implementation calls the
blobStore.Resume.I was able to reproduce the issue #45 only when using Docker with disabled containerd image store locally (the one that is used with
pussh) and only when pushing to a remote RPi with a relatively slow microSD. Apparently, the new Docker implementation ofdocker pushwhen using the containerd image store doesn't use the resume requests.The following errors in
containerdlogs are still logged whencontent.OpenWriterattempts to create a writer and waits until the lock is freed:which I believe is normal as I was able to find similar logs for the writers unrelated to unregistry on some of my machines. There is a comment in containerd to remove this noisy log line: https://github.com/containerd/containerd/blob/2f24aa00a58de442713ea60e4206041e00dcf012/plugins/services/content/contentserver/contentserver.go#L274-L275