etcd: fix a race in peer.go

This commit is contained in:
Xiang Li 2014-07-18 13:46:29 -07:00 committed by Yicheng Qin
parent 6dc49def25
commit 2e59635bea

View File

@ -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()
}()