diff --git a/internal/rpc/rpc.go b/internal/rpc/rpc.go index a96a3ec77..61c443bc7 100644 --- a/internal/rpc/rpc.go +++ b/internal/rpc/rpc.go @@ -240,7 +240,7 @@ func RetryStreamingServerStream[Req, Resp any]( } else { // Stream terminated; check if this was caused by an error err = stream.Err() - logLevel = log.Warn + logLevel = logLevelForError(err) break } } @@ -268,3 +268,12 @@ func RetryStreamingServerStream[Req, Resp any]( } } + +// useDebugErrorLevel indicates whether the specified error should be reported as a debug +// level log. +func logLevelForError(err error) log.Level { + if err != nil && strings.Contains(err.Error(), "connect: connection refused") { + return log.Debug + } + return log.Warn +}