@@ -35,10 +35,8 @@ import (
35
35
"github.com/pingcap/tidb/util/logutil"
36
36
"go.uber.org/zap"
37
37
"google.golang.org/grpc"
38
- gcodes "google.golang.org/grpc/codes"
39
38
"google.golang.org/grpc/credentials"
40
39
"google.golang.org/grpc/keepalive"
41
- gstatus "google.golang.org/grpc/status"
42
40
)
43
41
44
42
// MaxSendMsgSize set max gRPC request message size sent to server. If any request message size is larger than
@@ -618,8 +616,9 @@ func sendBatchRequest(
618
616
select {
619
617
case connArray .batchCommandsCh <- entry :
620
618
case <- ctx1 .Done ():
621
- logutil .Logger (context .Background ()).Warn ("send request is timeout" , zap .String ("to" , addr ))
622
- return nil , errors .Trace (gstatus .Error (gcodes .DeadlineExceeded , "Canceled or timeout" ))
619
+ logutil .Logger (context .Background ()).Warn ("send request is cancelled" ,
620
+ zap .String ("to" , addr ), zap .String ("cause" , ctx1 .Err ().Error ()))
621
+ return nil , errors .Trace (ctx1 .Err ())
623
622
}
624
623
625
624
select {
@@ -630,8 +629,9 @@ func sendBatchRequest(
630
629
return tikvrpc .FromBatchCommandsResponse (res ), nil
631
630
case <- ctx1 .Done ():
632
631
atomic .StoreInt32 (& entry .canceled , 1 )
633
- logutil .Logger (context .Background ()).Warn ("send request is canceled" , zap .String ("to" , addr ))
634
- return nil , errors .Trace (gstatus .Error (gcodes .DeadlineExceeded , "Canceled or timeout" ))
632
+ logutil .Logger (context .Background ()).Warn ("wait response is cancelled" ,
633
+ zap .String ("to" , addr ), zap .String ("cause" , ctx1 .Err ().Error ()))
634
+ return nil , errors .Trace (ctx1 .Err ())
635
635
}
636
636
}
637
637
0 commit comments