This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.1k
stars
1.21k
forks
source link
@azure/storage-blob - BlockBlobClient uploadStream - abortSignal ignored when the source stream is paused (hangs) #32028
Describe the bug
A clear and concise description of what the bug is.
When uploading a readable stream into a storage blob which in some point gets paused . BlockBlobClient.uploadStream ignores provided abortSignal and instead hangs (waits for stream resume I assume)
To Reproduce
Steps to reproduce the behavior:
it.only('should pass', async function() {
const filePath = __dirname + "/image.jpg";
const readable = fs.createReadStream(filePath);
const fileId = uuidV4();
const abortController = new AbortController();
const blockBlobClient = containerClient.getBlockBlobClient(fileId); //BlockBlobClient
const uploadReq = blockBlobClient.uploadStream(readable, undefined, undefined, {
abortSignal: abortController?.signal,
});
readable.pause(); //when this line is commented out, the test case passes, otherwise it times out
abortController.abort(new Error('abort error'));
expect(() => uploadReq).rejects.toThrowError('The operation was aborted.');
});
@azure/storage-blob
12.25.0
Linux
18.20.2
4.2.4
Describe the bug A clear and concise description of what the bug is.
When uploading a readable stream into a storage blob which in some point gets paused .
BlockBlobClient.uploadStream
ignores provided abortSignal and instead hangs (waits for stream resume I assume)To Reproduce Steps to reproduce the behavior:
Expected behavior
The upload request should be aborted.