Skip to content

Commit

Permalink
fix(forwarder): port v9 keepalive configs (#625)
Browse files Browse the repository at this point in the history
The forwarder will use KeepAlive params from GRPC, that uses HTTP/2 ping
frames, to check for broken connections and refresh. If not used, we'll
default to whatever the underlying OS is using to manage the port -
which is around 15-20 minutes.
  • Loading branch information
hspedro authored Jun 17, 2024
1 parent c9f296d commit 1aae5de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/adapters/events/forwarder_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
pb "github.com/topfreegames/protos/maestro/grpc/generated"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"
)

// Address represent a host:port to a grpc server that understand Event messages.
Expand Down Expand Up @@ -169,6 +170,7 @@ func (f *ForwarderClient) createGRPCConnection(address string) (*grpc.ClientConn
conn, err := grpc.Dial(
address,
dialOption,
grpc.WithKeepaliveParams(keepalive.ClientParameters{Time: 30 * time.Second, Timeout: 10 * time.Second, PermitWithoutStream: true}),
grpc.WithUnaryInterceptor(otgrpc.OpenTracingClientInterceptor(tracer)),
)
if err != nil {
Expand Down

0 comments on commit 1aae5de

Please sign in to comment.