pingcap / pingcap/tidb

goleak in the github.com/tikv/client-go/v2/config/retry.(*Config).createBackoffFn.newBackoffFn.func2

Open
#52,245 0 comments 0 reactions 0 assignees View on GitHub
component/test severity/moderate sig/transaction type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

### 2. What did you expect to see? (Required)

### 3. What did you see instead (Required)

```
--- PASS: TestLocalTemporaryTableNoNetworkWithInsideTxn (3.16s)
PASS
goleak: Errors on successful test run: found unexpected goroutines:
[Goroutine 267441 in state select, with github.com/tikv/client-go/v2/config/retry.(*Config).createBackoffFn.newBackoffFn.func2 on top of the stack:
github.com/tikv/client-go/v2/config/retry.(*Config).createBackoffFn.newBackoffFn.func2({0x3189990, 0xc04448ff80}, 0xffffffffffffffff)
external/com_github_tikv_client_go_v2/config/retry/config.go:205 +0x505
github.com/tikv/client-go/v2/config/retry.(*Backoffer).BackoffWithCfgAndMaxSleep(0xc05c6565a0, 0xc00090ca50, 0x21a4c60?, {0x3158660, 0xc0305b0930})
external/com_github_tikv_client_go_v2/config/retry/backoff.go:195 +0x66d
github.com/tikv/client-go/v2/config/retry.(*Backoffer).Backoff(0xc05c6565a0, 0xc00090ca50, {0x3158660, 0xc0305b0930})
external/com_github_tikv_client_go_v2/config/retry/backoff.go:122 +0x251
github.com/tikv/client-go/v2/internal/locate.(*replicaSelectorV2).onServerIsBusy(0xc0610f3e60, 0xc01db174d0?, 0x26743ca?, 0x0?, 0xc01db17330?)
external/com_github_tikv_client_go_v2/internal/locate/replica_selector.go:460 +0x2e6
github.com/tikv/client-go/v2/internal/locate.(*RegionRequestSender).onRegionError(0xc01e58ce00, 0xc05c6565a0, 0xc01e58f7c0, 0xc01e584700, 0xc01e272f70)
external/com_github_tikv_client_go_v2/internal/locate/region_request.go:2289 +0x863
github.com/tikv/client-go/v2/internal/locate.(*RegionRequestSender).SendReqCtx(0xc01e58ce00, 0xc05c6565a0, 0xc01e584700, {0x70, 0x1, 0x1}, 0x6fc23ac00, 0x0, {0x0, 0x0, ...})
external/com_github_tikv_client_go_v2/internal/locate/region_request.go:1652 +0x1775
github.com/tikv/client-go/v2/internal/locate.(*RegionRequestSender).SendReq(...)
external/com_github_tikv_client_go_v2/internal/locate/region_request.go:255
github.com/tikv/client-go/v2/tikv.(*KVStore).batchSendSingleRegion(0xc06aad6420, 0xc05c6565a0, {{0x70, 0x1, 0x1}, {0xc0305b08b8, 0x1, 0x1}, {0x0, 0x0, ...}, ...}, ...)
external/com_github_tikv_client_go_v2/tikv/split_region.go:152 +0x33c
github.com/tikv/client-go/v2/tikv.(*KVStore).splitBatchRegionsReq(0xc06aad6420, 0xc05c6565a0, {0xc022233548?, 0x1, 0xc05c6565a0?}, 0x0, 0xc0253238c0)
external/com_github_tikv_client_go_v2/tikv/split_region.go:92 +0x550
github.com/tikv/client-go/v2/tikv.(*KVStore).batchSendSingleRegion(0xc06aad6420, 0xc05c6565a0, {{0x6e, 0x1, 0x1}, {0xc022233548, 0x1, 0x1}, {0x0, 0x0, ...}, ...}, ...)
external/com_github_tikv_client_go_v2/tikv/split_region.go:170 +0x6bf
github.com/tikv/client-go/v2/tikv.(*KVStore).splitBatchRegionsReq(0xc06aad6420, 0xc05c6565a0, {0xc022233518?, 0x1, 0x5836d28?}, 0x0, 0xc0253238c0)
external/com_github_tikv_client_go_v2/tikv/split_region.go:92 +0x550
github.com/tikv/client-go/v2/tikv.(*KVStore).SplitRegions(0xc027580000?, {0x3189990?, 0xc04448ff80}, {0xc022233518, 0x1, 0x1}, 0xc0?, 0xc031e9cd01?)
external/com_github_tikv_client_go_v2/tikv/split_region.go:229 +0x18f
github.com/pingcap/tidb/pkg/ddl.SplitRecordRegion({0x3189990, 0xc04448ff80}, {0x7faafc031940, 0xc06aaf7680}, 0x68, 0x68, 0xe0?)
pkg/ddl/split_region.go:123 +0x1e5
github.com/pingcap/tidb/pkg/ddl.splitTableRegion({0x3207808?, 0xc01d08a240?}, {0x7faafc031940, 0xc06aaf7680}, 0xc01d0b4a80, 0x0)
pkg/ddl/split_region.go:61 +0x118
github.com/pingcap/tidb/pkg/ddl.preSplitAndScatter.func2()
pkg/ddl/ddl_api.go:3122 +0x2c
created by github.com/pingcap/tidb/pkg/ddl.preSplitAndScatter in goroutine 233605
pkg/ddl/ddl_api.go:3127 +0x509
]
```

https://tiprow.hawkingrei.com/view/gs/pingcapprow/pr-logs/pull/pingcap_tidb/52241/fast_test_tiprow/1773652531054907392#1:build-log.txt%3A8476

### 4. What is your TiDB version? (Required)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.