#6547·uppy

AWS S3 v6 以串行方式发送块,而不是并行发送 + 可能存在内存泄漏

作者: d-laskowski-trojmiasto创建于 2026年9月9日更新于 2026年9月15日
标签BugAWS S3

import { pausingUploadReason } from './MultipartUploader.js'; import { throwIfAborted } from './utils.js'; import pLimit from "p-limit"; function removeMetadataFromURL(urlString) { const urlObject = new URL(urlString); urlObject.search = ''; @@ -187,7 +188,7 @@ export class HTTPCommunicationQueue { signal, }).abortOn(signal); let body;

  •    const data = chunk.getData();
  •    const data = await chunk.getData();
       if (method.toUpperCase() === 'POST') {
           const formData = new FormData();
           Object.entries(fields).forEach(([key, value]) => formData.set(key, value));

@@ -225,7 +226,8 @@ export class HTTPCommunicationQueue { const { uploadId, key } = await this.getUploadId(file, signal); throwIfAborted(signal); try {

  •        const parts = await Promise.all(chunks.map((chunk, i) => this.uploadChunk(file, i + 1, chunk, signal)));
  •        const limit = pLimit(6);
  •        const parts = await Promise.all(chunks.map((chunk, i) => limit(() => this.uploadChunk(file, i + 1, chunk, signal))));
           throwIfAborted(signal);
           return await this.#sendCompletionRequest(this.#getFile(file), { key, uploadId, parts, signal }, signal).abortOn(signal);
       }

@@ -282,7 +284,7 @@ export class HTTPCommunicationQueue { }; for (;;) { throwIfAborted(signal);

  •        const chunkData = chunk.getData();
  •        let chunkData = await chunk.getData();
           const { onProgress, onComplete } = chunk;
           let signature;
           try {

@@ -305,7 +307,7 @@ export class HTTPCommunicationQueue { } throwIfAborted(signal); try {

  •            return {
  •            let data = {
                   PartNumber: partNumber,
                   ...(await this.#uploadPartBytes({
                       signature,

@@ -316,6 +318,8 @@ export class HTTPCommunicationQueue { signal, }).abortOn(signal)), …

内容来源: transloadit/uppy