mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-15 23:24:03 -06:00
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:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user