From f5a0d133657e7a9898b7f6a7fd7979cf6214a264 Mon Sep 17 00:00:00 2001 From: crazycs Date: Mon, 1 Apr 2024 17:19:48 +0800 Subject: [PATCH] Update internal/client/client_batch.go Co-authored-by: cfzjywxk --- internal/client/client_batch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/client/client_batch.go b/internal/client/client_batch.go index 2c915b545..5ba07c25a 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,