Skip to content

Commit

Permalink
Update internal/client/client_batch.go
Browse files Browse the repository at this point in the history
Co-authored-by: cfzjywxk <[email protected]>
  • Loading branch information
crazycs520 and cfzjywxk authored Apr 1, 2024
1 parent 600a560 commit f5a0d13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/client/client_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f5a0d13

Please sign in to comment.