Skip to content

Commit

Permalink
Merge branch 'master' of ssh://github.com/buildbuddy-io/buildbuddy
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerwilliams committed Sep 30, 2021
2 parents 260c90a + e4c90c6 commit ab37886
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion enterprise/server/cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func main() {
redisClient := redisutil.NewClient(redisTarget, healthChecker, "default_redis")
realEnv.SetDefaultRedisClient(redisClient)
r := redis_cache.NewCache(realEnv.GetDefaultRedisClient(), 0)
realEnv.SetMetricsCollector(r)
// realEnv.SetMetricsCollector(r)
realEnv.SetKeyValStore(r)
}

Expand Down
1 change: 1 addition & 0 deletions server/util/grpc_server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ go_library(
"@io_opentelemetry_go_otel//attribute",
"@io_opentelemetry_go_otel_trace//:trace",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//keepalive",
],
)
6 changes: 6 additions & 0 deletions server/util/grpc_server/grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"

grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
)
Expand Down Expand Up @@ -82,5 +83,10 @@ func CommonGRPCServerOptions(env environment.Env) []grpc.ServerOption {
grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor),
grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),
grpc.MaxRecvMsgSize(env.GetConfigurator().GetGRPCMaxRecvMsgSizeBytes()),
// Set to avoid errors: Bandwidth exhausted HTTP/2 error code: ENHANCE_YOUR_CALM Received Goaway too_many_pings
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
MinTime: 10 * time.Second, // If a client pings more than once every 10 seconds, terminate the connection
PermitWithoutStream: true, // Allow pings even when there are no active streams
}),
}
}

0 comments on commit ab37886

Please sign in to comment.