mirror of
https://github.com/rclone/rclone.git
synced 2025-02-01 11:09:39 +01:00
azureblob,oracleobjectstorage,s3: quit multipart uploads if the context is cancelled
Before this change the multipart uploads would continue retrying even if the context was cancelled.
This commit is contained in:
parent
e1748a3183
commit
96b32d8a87
@ -2162,6 +2162,9 @@ func (w *azChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, reader
|
|||||||
if chunkNumber <= 8 {
|
if chunkNumber <= 8 {
|
||||||
return w.f.shouldRetry(ctx, err)
|
return w.f.shouldRetry(ctx, err)
|
||||||
}
|
}
|
||||||
|
if fserrors.ContextError(ctx, &err) {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
// retry all chunks once have done the first few
|
// retry all chunks once have done the first few
|
||||||
return true, err
|
return true, err
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
"github.com/oracle/oci-go-sdk/v65/objectstorage"
|
"github.com/oracle/oci-go-sdk/v65/objectstorage"
|
||||||
"github.com/rclone/rclone/fs"
|
"github.com/rclone/rclone/fs"
|
||||||
"github.com/rclone/rclone/fs/chunksize"
|
"github.com/rclone/rclone/fs/chunksize"
|
||||||
|
"github.com/rclone/rclone/fs/fserrors"
|
||||||
"github.com/rclone/rclone/fs/hash"
|
"github.com/rclone/rclone/fs/hash"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -183,6 +184,9 @@ func (w *objectChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, rea
|
|||||||
if ossPartNumber <= 8 {
|
if ossPartNumber <= 8 {
|
||||||
return shouldRetry(ctx, resp.HTTPResponse(), err)
|
return shouldRetry(ctx, resp.HTTPResponse(), err)
|
||||||
}
|
}
|
||||||
|
if fserrors.ContextError(ctx, &err) {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
// retry all chunks once have done the first few
|
// retry all chunks once have done the first few
|
||||||
return true, err
|
return true, err
|
||||||
}
|
}
|
||||||
|
@ -6175,6 +6175,9 @@ func (w *s3ChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, reader
|
|||||||
if chunkNumber <= 8 {
|
if chunkNumber <= 8 {
|
||||||
return w.f.shouldRetry(ctx, err)
|
return w.f.shouldRetry(ctx, err)
|
||||||
}
|
}
|
||||||
|
if fserrors.ContextError(ctx, &err) {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
// retry all chunks once have done the first few
|
// retry all chunks once have done the first few
|
||||||
return true, err
|
return true, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user