containers / common

Location for shared common files in github.com/containers repos.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should pkg/retry retry on HTTP status 500? (502? others?)

Windfarer opened this issue · comments

when copy from remote repository, the current error retry does not handle status code 500 response. it seems there’s no handle for any error http status code in https://github.com/containers/common/blob/main/pkg/retry/retry.go
maybe this error status code handler would be implemented in skopeo?

Did you try using skopeo copy --retry-times N? It's set to 0 by default but you are free to set it to a value of your choice.

Can you elaborate on the reasoning for retrying on 500? If a server returns 500, it indicates something's seriously wrong. I don't think it's conventional to assume the next response would be any different.

There are quite a few situations, like running out of disk space, where retrying can make things worse. So I lean towards being conservative here, but I realize I tend to worry more than others.

Either way, this should be decided in c/common/pkg/retry (although it might need new error types exported from c/image as well, the heuristic needs to be decided in c/common), and Skopeo will not add a special case; transferring to that repo.