diff --git a/internal/client/client_batch.go b/internal/client/client_batch.go index 2c915b5458..5ba07c25ac 100644 --- a/internal/client/client_batch.go +++ b/internal/client/client_batch.go @@ -613,7 +613,7 @@ func (c *batchCommandsClient) send(forwardedHost string, req *tikvpb.BatchComman // failPendingRequests fails all pending requests which req.forwardedHost equals to forwardedHost parameter. // Why need check `forwardedHost`? Here is an example, when enable-forwarding is true, and this client has network issue with store1: // - some requests are sent to store1 with forwarding, such as forwardedHost is store2, those requests will succeed. -// - some requests are sent to store1 without forwarding, and maybe failed then call failPendingRequests, +// - some requests are sent to store1 without forwarding, and may fail then `failPendingRequests` would be called, // if we don't check `forwardedHost` and fail all pending requests, the requests with forwarding will be failed too. this may cause some issue: // 1. data race. see https://github.com/tikv/client-go/issues/1222 and TestRandomRestartStoreAndForwarding. // 2. panic which cause by `send on closed channel`, since failPendingRequests will close the entry.res channel,