"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
oracleobjectstorage: retry 409 ConcurrentObjectUpdate errors - fixes #10194
berceb3d0b38694d5
diff --git a/backend/oracleobjectstorage/client.go b/backend/oracleobjectstorage/client.goindex e44b35f22..89e43a453 100644--- a/backend/oracleobjectstorage/client.go+++ b/backend/oracleobjectstorage/client.go@@ -126,6 +126,10 @@ func shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, errif ociError.GetCode() == "RequestTimeout" {return true, err}+ // Parallel part uploads can collide on the same object+ if ociError.GetHTTPStatusCode() == http.StatusConflict && ociError.GetCode() == "ConcurrentObjectUpdate" {+ return true, err+ }}// Ok, not an oci error, check for generic failure conditionsreturn fserrors.ShouldRetry(err) || fserrors.ShouldRetryHTTP(resp, retryErrorCodes), errdiff --git a/backend/oracleobjectstorage/client_test.go b/backend/oracleobjectstorage/client_test.goindex 3fa33ea1e..40c38ab36 100644--- a/backend/oracleobjectstorage/client_test.go+++ b/backend/oracleobjectstorage/client_test.go@@ -102,3 +102,34 @@ func TestGzipEncoding(t *testing.T) {assert.Equal(t, "", md5sum)})}++// serviceError is a minimal common.ServiceError for shouldRetry+type serviceError struct {+ status int+ code string+}++func (e serviceError) Error() string { return e.code }+func (e serviceError) GetHTTPStatusCode() int { return e.status }+func (e serviceError) GetMessage() string { return e.code }+func (e serviceError) GetCode() string { return e.code }+func (e serviceError) GetOpcRequestID() string { return "" }++func TestShouldRetryServiceError(t *testing.T) {+ ctx := context.Background()+ for _, test := range []struct {+ status int+ code string+ want bool+ }{+ {http.StatusConflict, "ConcurrentObjectUpdate", true},+ {http.StatusConflict, "BucketAlreadyExists", false},+ {http.StatusRequestTimeout, "RequestTimeout", true},+ {http.StatusNotFound, "ObjectNotFound", false},+ } {+ err := serviceError{status: test.status, code: test.code}+ retry, gotErr := shouldRetry(ctx, nil, err)+ assert.Equal(t, test.want, retry, test.code)+ assert.Equal(t, error(err), gotErr)+ }+}