From c2ec89ab98e61e00a8853395fed0774f0d83f2e7 Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Mon, 31 Jul 2017 15:59:41 +0800 Subject: [PATCH] Fixed a retry TIMEOUT issue during uploading --- ChangeLog.md | 6 ++++++ lib/common/services/storageserviceclient.js | 14 +++++++------- lib/common/util/constants.js | 2 +- package.json | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 98ab7dca..6ba9c0cd 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -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 diff --git a/lib/common/services/storageserviceclient.js b/lib/common/services/storageserviceclient.js index 53e6d232..1f4d04ed 100644 --- a/lib/common/services/storageserviceclient.js +++ b/lib/common/services/storageserviceclient.js @@ -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); - } }; /** @@ -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 diff --git a/lib/common/util/constants.js b/lib/common/util/constants.js index b207f1c7..daf14afb 100644 --- a/lib/common/util/constants.js +++ b/lib/common/util/constants.js @@ -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. diff --git a/package.json b/package.json index e60f5994..c2ef1a26 100644 --- a/package.json +++ b/package.json @@ -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": [