Skip to content

Commit

Permalink
Merge pull request #338 from XiaoningLiu/issue_upload_timeout
Browse files Browse the repository at this point in the history
Fixed a retry TIMEOUT issue during uploading
  • Loading branch information
vinjiang authored Aug 7, 2017
2 parents 4c6aa19 + c2ec89a commit 22a82ee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Note: This is an Azure Storage only package. The all up Azure node sdk still has the old storage bits in there. In a future release, those storage bits will be removed and an npm dependency to this storage node sdk will
be taken. This is a GA release and the changes described below indicate the changes from the Azure node SDK 0.9.8 available here - https://github.com/Azure/azure-sdk-for-node.

2017.08 Version 2.2.2

ALL

* Fixed a retry timeout issue during uploading.

2017.07 Version 2.2.1

BLOB
Expand Down
14 changes: 7 additions & 7 deletions lib/common/services/storageserviceclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,7 @@ StorageServiceClient.prototype.setHost = function (host) {
* @param {function} callback The response callback function.
*/
StorageServiceClient.prototype.performRequest = function (webResource, outputData, options, callback) {
if (!azureutil.isBrowser() && Buffer.isBuffer(outputData)) {
// Request module will take 200MB additional memory when we pass a 100MB buffer as body
// Transfer buffer to stream will highly reduce the memory usage by request module
this._performRequest(webResource, { outputData: new BufferStream(outputData) }, options, callback);
} else {
this._performRequest(webResource, { outputData: outputData }, options, callback);
}
};

/**
Expand Down Expand Up @@ -440,7 +434,13 @@ StorageServiceClient.prototype._performRequest = function (webResource, body, op
};

if (body && body.outputData) {
finalRequestOptions.body = body.outputData;
if (!azureutil.isBrowser() && Buffer.isBuffer(body.outputData)) {
// Request module will take 200MB additional memory when we pass a 100MB buffer as body
// Transfer buffer to stream will highly reduce the memory used by request module
finalRequestOptions.body = new BufferStream(body.outputData);
} else {
finalRequestOptions.body = body.outputData;
}
}

// Pipe any input / output streams
Expand Down
2 changes: 1 addition & 1 deletion lib/common/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var Constants = {
/*
* Specifies the value to use for UserAgent header.
*/
USER_AGENT_PRODUCT_VERSION: '2.1.0',
USER_AGENT_PRODUCT_VERSION: '2.2.2',

/**
* The number of default concurrent requests for parallel operation.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure-storage",
"author": "Microsoft Corporation",
"version": "2.2.1",
"version": "2.2.2",
"description": "Microsoft Azure Storage Client Library for Node.js",
"typings": "typings/azure-storage/azure-storage.d.ts",
"tags": [
Expand Down

0 comments on commit 22a82ee

Please sign in to comment.