-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
server: fix potential goroutine leak when kill connection #13051
Conversation
if err != nil { | ||
metrics.ExecuteErrorCounter.WithLabelValues(metrics.ExecuteErrorToLabel(err)).Inc() | ||
return err | ||
} | ||
status := atomic.LoadInt32(&cc.status) | ||
if rs != nil && (status == connStatusShutdown || status == connStatusWaitShutdown) { | ||
killConn(cc) |
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.
Here it need not to killConn
again
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
maybe we can add a failpoint in conn.go:1153 to help TiBug regression test this @zyguan
@lysu I've updated test, now it can be covered by |
LGTM |
Codecov Report
@@ Coverage Diff @@
## master #13051 +/- ##
================================================
+ Coverage 80.0413% 80.0524% +0.0111%
================================================
Files 468 468
Lines 109852 109828 -24
================================================
- Hits 87927 87920 -7
+ Misses 15170 15161 -9
+ Partials 6755 6747 -8 |
Your auto merge job has been accepted, waiting for 12997 |
/run-all-tests |
/run-all-tests |
@SunRunAway merge failed. |
/merge |
/run-all-tests |
cherry pick to release-3.1 failed |
cherry pick to release-2.1 failed |
cherry pick to release-3.0 failed |
What problem does this PR solve?
Fix #13050
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes
Release note