mirror of
https://github.com/rclone/rclone.git
synced 2025-03-04 10:22:08 +01:00
azureblob: handle retry error codes more carefully
This commit is contained in:
parent
0ccf65017f
commit
5037d7368d
@ -656,13 +656,29 @@ func (f *Fs) shouldRetry(ctx context.Context, err error) (bool, error) {
|
||||
if fserrors.ContextError(ctx, &err) {
|
||||
return false, err
|
||||
}
|
||||
// FIXME interpret special errors - more to do here
|
||||
if storageErr, ok := err.(*azcore.ResponseError); ok {
|
||||
var storageErr *azcore.ResponseError
|
||||
if errors.As(err, &storageErr) {
|
||||
// General errors from:
|
||||
// https://learn.microsoft.com/en-us/rest/api/storageservices/common-rest-api-error-codes
|
||||
// Blob specific errors from:
|
||||
// https://learn.microsoft.com/en-us/rest/api/storageservices/blob-service-error-codes
|
||||
switch storageErr.ErrorCode {
|
||||
case "InvalidBlobOrBlock":
|
||||
// These errors happen sometimes in multipart uploads
|
||||
// because of block concurrency issues
|
||||
return true, err
|
||||
case "InternalError":
|
||||
// The server encountered an internal error. Please retry the request.
|
||||
return true, err
|
||||
case "OperationTimedOut":
|
||||
// The operation could not be completed within the permitted time. The
|
||||
// operation may or may not have succeeded on the server side. Please query
|
||||
// the server state before retrying the operation.
|
||||
return true, err
|
||||
case "ServerBusy":
|
||||
// The server is currently unable to receive requests. Please retry your
|
||||
// request.
|
||||
return true, err
|
||||
}
|
||||
statusCode := storageErr.StatusCode
|
||||
for _, e := range retryErrorCodes {
|
||||
|
Loading…
Reference in New Issue
Block a user