Skip to content
Merged
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
7 changes: 7 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ import (
"google.golang.org/grpc/status"
)

// maxConcurrentStreams bounds concurrent RPCs per client connection. The kernel serves a
// single co-located consensus client, so legitimate load stays far below this; the cap
// keeps a misbehaving peer from parking unbounded long-lived handlers (e.g. registration
// lag-retry waits).
const maxConcurrentStreams = 64

func Serve(cfg *config.Config) (*grpc.Server, chan error) {
errCh := make(chan error)

serverOpts := []grpc.ServerOption{
grpc.UnaryInterceptor(recoveryInterceptor()),
grpc.MaxConcurrentStreams(maxConcurrentStreams),
}

if cfg.GRPC.TLSEnabled() {
Expand Down
Loading