diff --git a/etcd/peer.go b/etcd/peer.go index a98c9f412..30bee9d60 100644 --- a/etcd/peer.go +++ b/etcd/peer.go @@ -89,8 +89,8 @@ func (p *peer) send(d []byte) error { if p.inflight.Get() > maxInflight { return fmt.Errorf("reach max idle") } + p.wg.Add(1) go func() { - p.wg.Add(1) p.post(d) p.wg.Done() }()