From c7f8168472386525d44527cadcb95b5ad543771e Mon Sep 17 00:00:00 2001 From: JmPotato Date: Thu, 2 Sep 2021 14:01:52 +0800 Subject: [PATCH] client: fix some typos (#296) Signed-off-by: JmPotato --- internal/client/client_batch.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/client/client_batch.go b/internal/client/client_batch.go index edd81746..c4a25203 100644 --- a/internal/client/client_batch.go +++ b/internal/client/client_batch.go @@ -278,7 +278,7 @@ func (a *batchConn) fetchMorePendingRequests( } after.Stop() - // Do an additional non-block try. Here we test the lengh with `maxBatchSize` instead + // Do an additional non-block try. Here we test the length with `maxBatchSize` instead // of `batchWaitSize` because trying best to fetch more requests is necessary so that // we can adjust the `batchWaitSize` dynamically. for a.reqBuilder.len() < maxBatchSize { @@ -316,7 +316,7 @@ func (a *batchConn) batchSendLoop(cfg config.TiKVClient) { a.pendingRequests.Observe(float64(len(a.batchCommandsCh))) a.batchSize.Observe(float64(a.reqBuilder.len())) - // curl -XPUT -d 'return(true)' http://0.0.0.0:10080/fail/github.com/tikv/client-go/v2/mockBlockOnBatchClient + // curl -X PUT -d 'return(true)' http://0.0.0.0:10080/fail/github.com/tikv/client-go/v2/mockBlockOnBatchClient if val, err := util.EvalFailpoint("mockBlockOnBatchClient"); err == nil { if val.(bool) { time.Sleep(1 * time.Hour) @@ -355,7 +355,7 @@ func (a *batchConn) getClientAndSend() { for i := 0; i < len(a.batchCommandsClients); i++ { a.index = (a.index + 1) % uint32(len(a.batchCommandsClients)) target = a.batchCommandsClients[a.index].target - // The lock protects the batchCommandsClient from been closed while it's inuse. + // The lock protects the batchCommandsClient from been closed while it's in use. if a.batchCommandsClients[a.index].tryLockForSend() { cli = a.batchCommandsClients[a.index] break @@ -644,7 +644,7 @@ func (c *batchCommandsClient) batchRecvLoop(cfg config.TiKVClient, tikvTransport } transportLayerLoad := resp.GetTransportLayerLoad() - if transportLayerLoad > 0.0 && cfg.MaxBatchWaitTime > 0 { + if transportLayerLoad > 0 && cfg.MaxBatchWaitTime > 0 { // We need to consider TiKV load only if batch-wait strategy is enabled. atomic.StoreUint64(tikvTransportLayerLoad, transportLayerLoad) }