From 505cf8c09a9eeed9ea56afb9f03e9b3ca0a104ee Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 24 Feb 2022 15:53:44 +0100 Subject: [PATCH] make gRPC error "to many keepalive pings" only show up in trace logs (#787) hotfix #717 This comes from the agent being inactive / not sending and requesting any data if there a no pipelines waiting for him to execute. GRPC seems to only allow 2 pings without calling an actual endpoint before closing the connection. I think this will be indirectly solved in the moment we implement something like #536 https://github.com/grpc/grpc/blob/master/doc/keepalive.md Co-authored-by: Anbraten --- pipeline/rpc/client_grpc.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pipeline/rpc/client_grpc.go b/pipeline/rpc/client_grpc.go index ab9687a4d..96913ec3f 100644 --- a/pipeline/rpc/client_grpc.go +++ b/pipeline/rpc/client_grpc.go @@ -3,6 +3,7 @@ package rpc import ( "context" "encoding/json" + "strings" "time" "github.com/rs/zerolog/log" @@ -46,7 +47,13 @@ func (c *client) Next(ctx context.Context, f Filter) (*Pipeline, error) { if err == nil { break } else { - log.Err(err).Msgf("grpc error: done(): code: %v: %s", status.Code(err), err) + // TODO: remove after adding continuous data exchange by something like #536 + if strings.Contains(err.Error(), "\"too_many_pings\"") { + // https://github.com/woodpecker-ci/woodpecker/issues/717#issuecomment-1049365104 + log.Trace().Err(err).Msg("grpc: to many keepalive pings without sending data") + } else { + log.Err(err).Msgf("grpc error: done(): code: %v: %s", status.Code(err), err) + } } switch status.Code(err) { case