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

aws-s3-multipart: fix queueing behaviours #1855

Merged
merged 3 commits into from
Oct 9, 2019

Conversation

goto-bus-stop
Copy link
Contributor

@goto-bus-stop goto-bus-stop commented Sep 30, 2019

Fixes an issue where the plugin was queueing too many things, causing deadlock. The entire MultipartUpload object was added as a queue entry, but then that object would queue more things, and wait for those things to complete; but the MultipartUpload objects were clogging up the queue, so those things would never start. Since the MultipartUpload object manages its requests internally, and it participates in the rate limiting queue, its requests don't need to be queued again.

Fixes an issue where cancelling many queued uploads would cause them to quickly start and then immediately be cancelled, because cancelling the ongoing uploads would synchronously push the queued uploads to the front of the upload queue, synchronously start them, and then synchronously cancel them. Now, queue items are not moved immediately when an earlier upload is cancelled, but wait until the end of the JavaScript tick before moving. The queue can be cleared out synchronously without causing queued items to start and then cancel.

Fixes #1146, where aws-s3-multipart would send abort requests for uploads that had not yet started (either because they were queued or because the createMultipartUpload() request was ongoing). Now, abort requests are not sent at all if an upload was not started, and abort requests wait for the createMultipartUpload() request to succeed before aborting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AwsS3Multipart plugin cancels upload with uploadId===null
1 participant