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

Drop lockedCandidatesForBatch and mark chunks as 'busy' on preparing as a fix for #3341 #3342

Merged
merged 3 commits into from Dec 7, 2021
Merged
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
7 changes: 3 additions & 4 deletions packages/@uppy/aws-s3-multipart/src/MultipartUploader.js
Expand Up @@ -58,7 +58,6 @@ class MultipartUploader {
this.partsInProgress = 0
this.chunks = null
this.chunkState = null
this.lockedCandidatesForBatch = []

this.#initChunks()

Expand Down Expand Up @@ -181,8 +180,6 @@ class MultipartUploader {

const candidates = []
for (let i = 0; i < this.chunkState.length; i++) {
// eslint-disable-next-line no-continue
if (this.lockedCandidatesForBatch.includes(i)) continue
const state = this.chunkState[i]
// eslint-disable-next-line no-continue
if (state.done || state.busy) continue
Expand Down Expand Up @@ -242,7 +239,9 @@ class MultipartUploader {
}

async #prepareUploadParts (candidates) {
this.lockedCandidatesForBatch.push(...candidates)
candidates.forEach((i) => {
this.chunkState[i].busy = true
})

const result = await this.#retryable({
attempt: () => this.options.prepareUploadParts({
Expand Down