@sentio/cli 4.0.0-rc.2 → 4.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +2 -1
- package/package.json +1 -1
- package/src/commands/upload.ts +6 -1
package/lib/index.js
CHANGED
|
@@ -165295,7 +165295,8 @@ async function uploadFile(config, auth, options) {
|
|
|
165295
165295
|
try {
|
|
165296
165296
|
await upload2();
|
|
165297
165297
|
} catch (e3) {
|
|
165298
|
-
|
|
165298
|
+
const RETRYABLE_CODES = ["EPIPE", "ECONNRESET", "ETIMEDOUT", "ECONNREFUSED", "EAI_AGAIN"];
|
|
165299
|
+
if (e3?.constructor.name === "FetchError" && e3.type === "system" && RETRYABLE_CODES.includes(e3.code)) {
|
|
165299
165300
|
error = e3;
|
|
165300
165301
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
165301
165302
|
await tryUploading();
|
package/package.json
CHANGED
package/src/commands/upload.ts
CHANGED
|
@@ -738,7 +738,12 @@ export async function uploadFile(
|
|
|
738
738
|
try {
|
|
739
739
|
await upload()
|
|
740
740
|
} catch (e: any) {
|
|
741
|
-
|
|
741
|
+
// Transient network errors while PUT-ing the packed processor to the signed
|
|
742
|
+
// storage URL: node-fetch surfaces these as `FetchError` with `type: 'system'`
|
|
743
|
+
// and the underlying socket errno in `code`. Retry all of them, not just EPIPE
|
|
744
|
+
// (ECONNRESET / "socket hang up" is the most common one against GCS).
|
|
745
|
+
const RETRYABLE_CODES = ['EPIPE', 'ECONNRESET', 'ETIMEDOUT', 'ECONNREFUSED', 'EAI_AGAIN']
|
|
746
|
+
if (e?.constructor.name === 'FetchError' && e.type === 'system' && RETRYABLE_CODES.includes(e.code)) {
|
|
742
747
|
error = e
|
|
743
748
|
await new Promise((resolve) => setTimeout(resolve, 1000))
|
|
744
749
|
await tryUploading()
|