remotes/docker: Only return "already exists" on push when the upload was sucessful#5276
Conversation
|
Hi @aaronlehmann. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Somewhat related to this PR: |
Some registries can be flaky and return intermittent 5xx errors. This change allows those errors to be retried, similarly to network-level errors. Note that this needs the upstream containerd fix containerd/containerd#5276 to work reliably. This was tested with a registry that was modified to return 504 on every other manifest PUT. Without the change, exports to the registry fail every other attempt. With the change and the related containerd change, exports to the registry always succeed. Signed-off-by: Aaron Lehmann <[email protected]>
|
Build succeeded.
|
e23c649 to
aea6a5f
Compare
|
Build succeeded.
|
|
Hi 👋 @aaronlehmann long time no see 🤗 |
|
@aaronlehmann related to What has been your experience with push here though? This code flow hasn't been tested extensively outside of buildkit use cases |
This came up in a buildkit context. |
|
@dmcgowan: Would you happen to be the right person to review this? It would be great to get it upstream! |
|
@aaronlehmann I saw your PR in BuildKit linking to this one (moby/buildkit#2043) was to handle 5xx errors; is this fix related to / trying to solve the same issue as #5288 ? /cc @kzys |
|
No, I wasn't aware of that issue. The problem I was trying to solve was flaky infrastructure causing sporadic 5xx errors which caused pushes to fail. |
Yes, but I am still trying to understand this state a little better. Completed seems like it might share some state with committed, these states don't transfer well from the registry API to content API |
|
The issue here was that the check near the beginning of I'm fine with renaming it to |
|
Why I think it still doesn't transfer well is because the content API works a little differently than this. The My only reservation is related to making any changes to |
aea6a5f to
4ba9a24
Compare
|
Thanks, that makes sense. I've modified this to rename the field to I'm not completely clear on how the |
|
Build succeeded.
|
|
@aaronlehmann actually this works great, thanks! LGTM merge might be on hold still until CI issues resolved |
4ba9a24 to
cabdd7f
Compare
|
Build succeeded.
|
cabdd7f to
6015315
Compare
|
Build succeeded.
|
|
Is there a known issue with CI? I've tried a few times since yesterday and continue to see these failures. |
yeah rebase and you should be good now |
6015315 to
58bfb14
Compare
|
Build succeeded.
|
…was successful The `(dockerPusher).Push` method uses a `StatusTracker` to check if an upload already happened, before repeating the upload. However, there is no provision for failure handling. If a PUT request returns an error, the `StatusTracker` will still see the upload as if it happened successfully. Add a status boolean so that only successful uploads short-circuit `Push`. Signed-off-by: Aaron Lehmann <[email protected]>
58bfb14 to
4c1fa57
Compare
|
Build succeeded.
|
Some registries can be flaky and return intermittent 5xx errors. This change allows those errors to be retried, similarly to network-level errors. Note that this needs the upstream containerd fix containerd/containerd#5276 to work reliably. This was tested with a registry that was modified to return 504 on every other manifest PUT. Without the change, exports to the registry fail every other attempt. With the change and the related containerd change, exports to the registry always succeed. Signed-off-by: Aaron Lehmann <[email protected]> (cherry picked from commit d3b96f4)
The
(dockerPusher).Pushmethod uses aStatusTrackerto check if anupload already happened, before repeating the upload. However, there is
no provision for failure handling. If a PUT request returns an error,
the
StatusTrackerwill still see the upload as if it happenedsuccessfully. Add a status boolean so that only successful uploads
short-circuit
Push.Signed-off-by: Aaron Lehmann [email protected]