fix(provider-runtime): retry transient socket failures (#122535)

* test: cover UND_ERR_SOCKET retry recovery

Punchcard-Session: golden-cedar-brook-4q

* fix(provider-runtime): retry UND_ERR_SOCKET failures

Punchcard-Session: golden-cedar-brook-4q
This commit is contained in:
Vincent Koc
2026-08-12 16:16:22 +08:00
committed by GitHub
parent 83649466fa
commit dfbdbf2a67
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -838,6 +838,7 @@ describe("isRecoverableAgentWaitError", () => {
"EHOSTUNREACH",
"ENETUNREACH",
"EAI_AGAIN",
"UND_ERR_SOCKET",
])("recovers from %s connection failures", (code) => {
expect(isRecoverableAgentWaitError(`connect ${code} 127.0.0.1:443`)).toBe(true);
});
+1 -1
View File
@@ -55,7 +55,7 @@ const TRANSIENT_NETWORK_MESSAGE_SNIPPETS = [
];
const RETRYABLE_CONNECTION_ERROR_CODE_RE =
/\b(?:ECONNRESET|ECONNREFUSED|ETIMEDOUT|EPIPE|EHOSTUNREACH|ENETUNREACH|EAI_AGAIN)\b/i;
/\b(?:ECONNRESET|ECONNREFUSED|ETIMEDOUT|EPIPE|EHOSTUNREACH|ENETUNREACH|EAI_AGAIN|UND_ERR_SOCKET)\b/i;
function isWrappedFetchFailedMessage(message: string): boolean {
if (message === "fetch failed") {
@@ -51,6 +51,7 @@ describe("executeProviderOperationWithRetry", () => {
"EHOSTUNREACH",
"ENETUNREACH",
"EAI_AGAIN",
"UND_ERR_SOCKET",
"ENOTFOUND",
])("retries %s network failures from structured errors", async (code) => {
const cause = Object.assign(new Error("connect failed"), { code });