mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 11:51:02 +00:00
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 <anton@ju60.de>
This commit is contained in:
parent
f97f6f25b3
commit
505cf8c09a
1 changed files with 8 additions and 1 deletions
|
@ -3,6 +3,7 @@ package rpc
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
@ -45,9 +46,15 @@ func (c *client) Next(ctx context.Context, f Filter) (*Pipeline, error) {
|
|||
res, err = c.client.Next(ctx, req)
|
||||
if err == nil {
|
||||
break
|
||||
} else {
|
||||
// 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
|
||||
codes.Aborted,
|
||||
|
|
Loading…
Reference in a new issue