fix: keep pod log streams alive

This commit is contained in:
2026-09-27 11:37:02 +00:00 Unverified
parent 5f7509a9c5
commit d3e9753c4b
8 changed files with 32 additions and 9 deletions
+11 -2
View File
@@ -40,10 +40,19 @@ function logError(error: unknown): KubernetesLogError {
error && typeof error === "object" && "code" in error
? error.code
: undefined;
const transientNetworkCodes = new Set([
"ECONNRESET", "ETIMEDOUT", "EPIPE", "ECONNREFUSED", "EHOSTUNREACH",
"ENETUNREACH", "ECONNABORTED", "EAI_AGAIN", "UND_ERR_SOCKET",
"UND_ERR_CONNECT_TIMEOUT",
]);
const message = error instanceof Error ? error.message : "";
return new KubernetesLogError(
error instanceof Error ? error.message : "Kubernetes log request failed",
code === undefined &&
(status === undefined || status === 408 || status === 429 || status >= 500),
typeof code === "string"
? transientNetworkCodes.has(code)
: status === undefined && /socket hang up|socket closed/i.test(message)
? true
: status === undefined || status === 408 || status === 429 || status >= 500,
);
}