Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gRPC keepalive parameters #318

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 11.11.1
---------------
* Add keepalive config to gRPC dial parameters

Version 11.11.0
---------------
* Add a gRPC API to Lucidity which can be used to programmatically retrieve workers
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.11.0
11.11.1
1 change: 1 addition & 0 deletions grpcutil/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ go_library(
"///third_party/go/google.golang.org_grpc//grpclog",
"///third_party/go/google.golang.org_grpc//health",
"///third_party/go/google.golang.org_grpc//health/grpc_health_v1",
"///third_party/go/google.golang.org_grpc//keepalive",
"///third_party/go/google.golang.org_grpc//metadata",
"///third_party/go/google.golang.org_grpc//reflection",
"///third_party/go/gopkg.in_op_go-logging.v1//:go-logging.v1",
Expand Down
6 changes: 6 additions & 0 deletions grpcutil/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import (
"crypto/x509"
"io/ioutil"
"strings"
"time"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/keepalive"
)

// Dial is a convenience function wrapping up some common gRPC functionality.
Expand All @@ -22,6 +24,10 @@ func Dial(address string, tls bool, caFile, tokenFile string) (*grpc.ClientConn,
func DialOptions(tokenFile string) []grpc.DialOption {
opts := []grpc.DialOption{
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(419430400)),
grpc.WithKeepaliveParams(keepalive.ClientParameters{
Time: 20 * time.Second,
Timeout: 20 * time.Second,
}),
}
if tokenFile == "" {
return opts
Expand Down
Loading