Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(s3): make leavePartsOnError default to true #4414

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/lib-storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ try {
], // optional tags
queueSize: 4, // optional concurrency configuration
partSize: 1024 * 1024 * 5, // optional size of each part, in bytes, at least 5MB
leavePartsOnError: false, // optional manually handle dropped parts
leavePartsOnError: true, // optional throw error on failed parts

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this flag name is confusing. I'm bad with naming but maybe change it to something like

Suggested change
leavePartsOnError: true, // optional throw error on failed parts
throwOnPartsError: true, // optional throw error on failed parts

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's a bad name, but that would be an even more breaking change. maybe a todo for the future?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right

});

parallelUploads3.on("httpUploadProgress", (progress) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/lib-storage/src/Upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Upload extends EventEmitter {
// Defaults.
private queueSize = 4;
private partSize = MIN_PART_SIZE;
private leavePartsOnError = false;
private leavePartsOnError = true;
private tags: Tag[] = [];

private client: S3Client;
Expand Down
8 changes: 4 additions & 4 deletions lib/lib-storage/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PutObjectCommandInput, S3Client, Tag } from "@aws-sdk/client-s3";
import { AbortController } from "@aws-sdk/abort-controller";
import { PutObjectCommandInput, S3Client, Tag } from "@aws-sdk/client-s3";

export interface Progress {
loaded?: number;
Expand Down Expand Up @@ -31,9 +31,9 @@ export interface Configuration {
partSize: number;

/**
* Default: false
* Whether to abort the multipart upload if an error occurs. Set to true if you want to handle failures manually. If set to false (default)
* the upload will drop parts that have failed.
* Default: true
* Whether to abort the multipart upload if an error occurs (default.) Set to true if you want to handle failures manually (or retry if using a retry strategy). If set to false
* the upload will silently drop parts that have failed.
*/
leavePartsOnError: boolean;

Expand Down