From f50dcfd6997da66fe14d88226b73d3568f959848 Mon Sep 17 00:00:00 2001 From: carrolp Date: Thu, 1 Dec 2022 15:38:25 -0500 Subject: [PATCH] razeedeploy-core 1.3.3 for list hang fix and split requests (#382) --- package-lock.json | 14 +++++++------- package.json | 2 +- src/RemoteResourceGitController.js | 6 ++++-- src/RemoteResourceS3Controller.js | 1 + 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0ab3d298..c221de4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@razee/kubernetes-util": "^1.1.0", - "@razee/razeedeploy-core": "^1.3.2", + "@razee/razeedeploy-core": "^1.3.3", "axios": "^0.27.2", "bunyan": "^1.8.15", "clone": "^2.1.2", @@ -737,9 +737,9 @@ } }, "node_modules/@razee/razeedeploy-core": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@razee/razeedeploy-core/-/razeedeploy-core-1.3.2.tgz", - "integrity": "sha512-gfUJpAe12+xVOR1AlvZGkbgrTDyfRaak9zF1iAP238KTzruLN94Ab0KNTJmbLqDKhPsU7Hzz+KkNVBGIluBKGw==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@razee/razeedeploy-core/-/razeedeploy-core-1.3.3.tgz", + "integrity": "sha512-pt5W67ofTTTbqbnGH0QZHzv9f+wyv/nDrOH2/06yYYI0TlXR1sfRdOgijr9FlcZ96YbI37K1lB0abuio8fBvBg==", "dependencies": { "@razee/kubernetes-util": "^1.0.2", "bunyan": "^1.8.15", @@ -6731,9 +6731,9 @@ } }, "@razee/razeedeploy-core": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@razee/razeedeploy-core/-/razeedeploy-core-1.3.2.tgz", - "integrity": "sha512-gfUJpAe12+xVOR1AlvZGkbgrTDyfRaak9zF1iAP238KTzruLN94Ab0KNTJmbLqDKhPsU7Hzz+KkNVBGIluBKGw==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@razee/razeedeploy-core/-/razeedeploy-core-1.3.3.tgz", + "integrity": "sha512-pt5W67ofTTTbqbnGH0QZHzv9f+wyv/nDrOH2/06yYYI0TlXR1sfRdOgijr9FlcZ96YbI37K1lB0abuio8fBvBg==", "requires": { "@razee/kubernetes-util": "^1.0.2", "bunyan": "^1.8.15", diff --git a/package.json b/package.json index 4c3309f2..38fc4036 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "license": "Apache-2.0", "dependencies": { "@razee/kubernetes-util": "^1.1.0", - "@razee/razeedeploy-core": "^1.3.2", + "@razee/razeedeploy-core": "^1.3.3", "axios": "^0.27.2", "bunyan": "^1.8.15", "clone": "^2.1.2", diff --git a/src/RemoteResourceGitController.js b/src/RemoteResourceGitController.js index 26e930da..1c40ec8d 100644 --- a/src/RemoteResourceGitController.js +++ b/src/RemoteResourceGitController.js @@ -18,6 +18,7 @@ const loggerFactory = require('./bunyan-api'); const objectPath = require('object-path'); const request = require('request-promise-native'); const clone = require('clone'); +const hash = require('object-hash'); const { BaseDownloadController } = require('@razee/razeedeploy-core'); @@ -48,7 +49,7 @@ module.exports = class RemoteResourceGitController extends BaseDownloadControlle let reqOpt = clone(req.options); const optional = req.optional || false; const gitinfo = objectPath.get(req, 'options.git'); - + if (gitinfo) { try { reqOpt = await this._fetchHeaderSecrets(reqOpt); @@ -77,6 +78,7 @@ module.exports = class RemoteResourceGitController extends BaseDownloadControlle reqOpt = git.getAddlHeaders(reqOpt); const newReq = clone(req); newReq.options = reqOpt; + newReq.splitRequestId = hash(req); // By setting splitRequestId, all requests split from a single original request will all be attempted before allowing failures to abort newRequests.push(newReq); } } @@ -94,7 +96,7 @@ module.exports = class RemoteResourceGitController extends BaseDownloadControlle newRequests.push(req); } } - + if (newRequests.length > 0) { objectPath.set(this.data, ['object', 'spec', 'requests'], newRequests); let result = await super.added(); diff --git a/src/RemoteResourceS3Controller.js b/src/RemoteResourceS3Controller.js index 803dd962..29fa1ee8 100644 --- a/src/RemoteResourceS3Controller.js +++ b/src/RemoteResourceS3Controller.js @@ -44,6 +44,7 @@ module.exports = class RemoteResourceS3Controller extends BaseDownloadController const url = new URL(objectPath.get(r, 'options.url')); if (url.pathname.endsWith('/')) { //This is an S3 bucket let additionalRequests = await this._getBucketObjectRequestList(r); + additionalRequests.forEach( newReq => newReq.splitRequestId = hash(r) ); // By setting splitRequestId, all requests split from a single original request will all be attempted before allowing failures to abort newRequests = newRequests.concat(additionalRequests); } else { newRequests.push(r);