-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: fix goleak in the client-go #49046
Conversation
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
/check-issue-triage-complete |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #49046 +/- ##
================================================
+ Coverage 70.9922% 72.5168% +1.5245%
================================================
Files 1368 1391 +23
Lines 403975 410975 +7000
================================================
+ Hits 286791 298026 +11235
+ Misses 97214 94139 -3075
+ Partials 19970 18810 -1160
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -80,7 +80,7 @@ func RunTestMain(m *testing.M) { | |||
goleak.IgnoreTopFunction("net/http.(*persistConn).writeLoop"), | |||
goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/txnkv/transaction.keepAlive"), | |||
// backoff function will lead to sleep, so there is a high probability of goroutine leak while it's doing backoff. | |||
goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.(*Config).createBackoffFn.newBackoffFn.func2"), | |||
goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/config/retry.(*Config).createBackoffFn.newBackoffFn.func2"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could change all files,
./tests/realtikvtest/testkit.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./tests/realtikvtest/testkit.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.(*Config).createBackoffFn.newBackoffFn.func2"),
./docs/design/2021-04-26-lock-view.md: * There are two types of deadlock errors internally: retryable or non-retryable. The transaction will internally retry on retryable deadlocks and won't report error to the client. Therefore, the user are typically more interested in the non-retryable deadlocks.
./br/pkg/lightning/backend/backend.go: importMaxRetryTimes = 3 // tikv-importer has done retry internally. so we don't retry many times.
./pkg/sessiontxn/isolation/optimistic.go:// If the session is already in transaction, enable retry or internal SQL could retry.
./pkg/sessiontxn/isolation/optimistic.go: // The internal transaction could always retry.
./pkg/store/copr/copr_test/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/nontransactionaltest/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/bootstraptest/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/test/vars/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/test/txn/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/test/variable/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/test/meta/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/test/privileges/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/test/common/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/test/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/clusteredindextest/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/schematest/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/temporarytabletest/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
./pkg/session/main_test.go: goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/internal/retry.newBackoffFn.func1"),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, lance6716, you06 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: close #49038
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.