diff --git a/lib/db/errors.go b/lib/db/errors.go index 67c5fa2e9..a1f3aa03b 100644 --- a/lib/db/errors.go +++ b/lib/db/errors.go @@ -3,6 +3,8 @@ package db import ( "errors" "io" + "log/slog" + "net" "syscall" ) @@ -10,6 +12,7 @@ var retryableErrs = []error{ syscall.ECONNRESET, syscall.ECONNREFUSED, io.EOF, + syscall.ETIMEDOUT, } func isRetryableError(err error) bool { @@ -23,5 +26,12 @@ func isRetryableError(err error) bool { } } + if netErr, ok := err.(net.Error); ok { + if netErr.Timeout() { + slog.Warn("caught a net.Error in isRetryableError", slog.Any("err", err)) + return true + } + } + return false }