Skip to content

Commit

Permalink
etcd: config etcd3 client's max response size (#3891)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiang90 authored and jefferai committed Feb 2, 2018
1 parent 556916e commit 6a22114
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions physical/etcd/etcd3.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ func newEtcd3Backend(conf map[string]string, logger log.Logger) (physical.Backen
cfg.Password = password
}

if maxReceive, ok := conf["max_receive_size"]; ok {
// grpc converts this to uint32 internally, so parse as that to avoid passing invalid values
val, err := strconv.ParseUint(maxReceive, 10, 32)
if err != nil {
return nil, fmt.Errorf("value [%v] of 'max_receive_size' could not be understood", maxReceive)
}
cfg.MaxCallRecvMsgSize = int(val)
}

etcd, err := clientv3.New(cfg)
if err != nil {
return nil, err
Expand Down

0 comments on commit 6a22114

Please sign in to comment.