From 6df9950b6cde77aff59cf03155fc9944708ba737 Mon Sep 17 00:00:00 2001 From: Ashwin Sangem Date: Wed, 23 Mar 2022 16:44:40 +0530 Subject: [PATCH 1/3] Cap the cache download chunk to 2 GB --- src/internal/downloadUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/internal/downloadUtils.ts b/src/internal/downloadUtils.ts index 44cf7f3..cd1c36d 100644 --- a/src/internal/downloadUtils.ts +++ b/src/internal/downloadUtils.ts @@ -240,7 +240,8 @@ export async function downloadCacheStorageSDK( // // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB // on 64-bit systems), split the download into multiple segments - const maxSegmentSize = buffer.constants.MAX_LENGTH + // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly. + const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH)buffer.constants.MAX_LENGTH const downloadProgress = new DownloadProgress(contentLength) const fd = fs.openSync(archivePath, 'w') From c2a609193c59f58ff16d0b02ab9870fd94218c29 Mon Sep 17 00:00:00 2001 From: Ashwin Sangem Date: Wed, 23 Mar 2022 16:46:52 +0530 Subject: [PATCH 2/3] Update downloadUtils.ts --- src/internal/downloadUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/downloadUtils.ts b/src/internal/downloadUtils.ts index cd1c36d..bedaa37 100644 --- a/src/internal/downloadUtils.ts +++ b/src/internal/downloadUtils.ts @@ -241,7 +241,7 @@ export async function downloadCacheStorageSDK( // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB // on 64-bit systems), split the download into multiple segments // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly. - const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH)buffer.constants.MAX_LENGTH + const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH) const downloadProgress = new DownloadProgress(contentLength) const fd = fs.openSync(archivePath, 'w') From 1fd14077417e5dda5d651073dadec4cd97372dd5 Mon Sep 17 00:00:00 2001 From: Ashwin Sangem Date: Thu, 24 Mar 2022 11:19:52 +0000 Subject: [PATCH 3/3] bumped up the @action/cache version. --- RELEASES.md | 5 ++++- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index cce6d32..a6fdec7 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -49,4 +49,7 @@ - Use @azure/storage-blob v12.8.0 ### 1.0.10 -- Update `lockfileVersion` to `v2` in `package-lock.json [#1022](https://github.com/actions/toolkit/pull/1022) \ No newline at end of file +- Update `lockfileVersion` to `v2` in `package-lock.json [#1022](https://github.com/actions/toolkit/pull/1022) + +### 1.0.11 +- Fix file downloads > 2GB([issue](https://github.com/actions/cache/issues/773)) diff --git a/package-lock.json b/package-lock.json index 126c8fd..2d7af85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/cache", - "version": "1.0.10", + "version": "1.0.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/cache", - "version": "1.0.10", + "version": "1.0.11", "license": "MIT", "dependencies": { "@actions/core": "^1.2.6", diff --git a/package.json b/package.json index b675f49..7b7c31a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@actions/cache", - "version": "1.0.10", + "version": "1.0.11", "preview": true, "description": "Actions cache lib", "keywords": [