Browse Source

node: use GRPCMaxOpenConnections when creating the gRPC server (#4349)

not MaxOpenConnections

Fixes #4311

Also, set MaxBodyBytes, MaxHeaderBytes and WriteTimeout similar to HTTP
server.
pull/4355/head
Anton Kaliaev 5 years ago
committed by GitHub
parent
commit
587ac3a563
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions
  1. +2
    -3
      CHANGELOG_PENDING.md
  2. +10
    -1
      node/node.go

+ 2
- 3
CHANGELOG_PENDING.md View File

@ -24,6 +24,5 @@ program](https://hackerone.com/tendermint).
### BUG FIXES: ### BUG FIXES:
- [rpc] [#\4319] Check BlockMeta is not nil in Blocks & BlockByHash
- [node] [#\4311] Use `GRPCMaxOpenConnections` when creating the gRPC server, not `MaxOpenConnections`
- [rpc] [#\4319] Check `BlockMeta` is not nil in `/block` & `/block_by_hash`

+ 10
- 1
node/node.go View File

@ -948,7 +948,16 @@ func (n *Node) startRPC() ([]net.Listener, error) {
grpcListenAddr := n.config.RPC.GRPCListenAddress grpcListenAddr := n.config.RPC.GRPCListenAddress
if grpcListenAddr != "" { if grpcListenAddr != "" {
config := rpcserver.DefaultConfig() config := rpcserver.DefaultConfig()
config.MaxOpenConnections = n.config.RPC.MaxOpenConnections
config.MaxBodyBytes = n.config.RPC.MaxBodyBytes
config.MaxHeaderBytes = n.config.RPC.MaxHeaderBytes
// NOTE: GRPCMaxOpenConnections is used, not MaxOpenConnections
config.MaxOpenConnections = n.config.RPC.GRPCMaxOpenConnections
// If necessary adjust global WriteTimeout to ensure it's greater than
// TimeoutBroadcastTxCommit.
// See https://github.com/tendermint/tendermint/issues/3435
if config.WriteTimeout <= n.config.RPC.TimeoutBroadcastTxCommit {
config.WriteTimeout = n.config.RPC.TimeoutBroadcastTxCommit + 1*time.Second
}
listener, err := rpcserver.Listen(grpcListenAddr, config) listener, err := rpcserver.Listen(grpcListenAddr, config)
if err != nil { if err != nil {
return nil, err return nil, err


Loading…
Cancel
Save