File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
sdks/go/pkg/beam/runners/prism/internal/jobservices Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import (
3030 jobpb "github.com/apache/beam/sdks/v2/go/pkg/beam/model/jobmanagement_v1"
3131 "github.com/apache/beam/sdks/v2/go/pkg/beam/runners/prism/internal/worker"
3232 "google.golang.org/grpc"
33+ "google.golang.org/grpc/keepalive"
3334)
3435
3536type Server struct {
@@ -78,8 +79,13 @@ func NewServer(port int, execute func(*Job)) *Server {
7879 logger : slog .Default (), // TODO substitute with a configured logger.
7980 }
8081 s .logger .Info ("Serving JobManagement" , slog .String ("endpoint" , s .Endpoint ()))
82+
8183 opts := []grpc.ServerOption {
8284 grpc .MaxRecvMsgSize (math .MaxInt32 ),
85+ grpc .KeepaliveEnforcementPolicy (keepalive.EnforcementPolicy {
86+ MinTime : 20 * time .Second , // Minimum duration a client should wait before sending a keepalive ping
87+ PermitWithoutStream : true , // Allow pings even if there are no active streams
88+ }),
8389 }
8490 s .server = grpc .NewServer (opts ... )
8591 jobpb .RegisterJobServiceServer (s .server , s )
You can’t perform that action at this time.
0 commit comments