mirror of https://github.com/tikv/client-go.git
fix context leak in rawkv.BatchPut (#697)
Signed-off-by: Ping Yu <yuping@pingcap.com>
This commit is contained in:
parent
29dfcc2729
commit
9b06301c47
|
|
@ -899,13 +899,17 @@ func (c *Client) sendBatchPut(bo *retry.Backoffer, keys, values [][]byte, ttls [
|
||||||
|
|
||||||
for i := 0; i < len(batches); i++ {
|
for i := 0; i < len(batches); i++ {
|
||||||
if e := <-ch; e != nil {
|
if e := <-ch; e != nil {
|
||||||
cancel()
|
|
||||||
// catch the first error
|
// catch the first error
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = errors.WithStack(e)
|
err = errors.WithStack(e)
|
||||||
|
cancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
cancel()
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue