-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: close all connection directly when terminate tidb #8692
Conversation
@winkyao @tiancaiamao PTAL |
/run-all-tests |
@@ -153,6 +153,10 @@ func (cc *clientConn) Close() error { | |||
delete(cc.server.clients, cc.connectionID) | |||
connections := len(cc.server.clients) | |||
cc.server.rwlock.Unlock() | |||
return closeConn(cc, connections) |
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.
Will Close
be called twice?
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.
Normally won't.
https://github.com/pingcap/tidb/blob/master/server/conn.go#L458 There will check connection status to avoid double close.
LGTM |
Please stop the schemaValidator in the beginning of the domain.Close. |
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.
Rest LGTM
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
/rebuild |
/run-all-tests |
/run-unit-test |
/run-common-test |
3eefde1
to
ce96f37
Compare
ce96f37
to
fb0bab1
Compare
/run-all-tests |
/rebuild |
/rebuild |
/run-all-tests |
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
/rebuild |
/run-all-tests |
What problem does this PR solve?
Close all connection directly when terminate tidb.
Currently, if TiDB got terminated signal, TiDB will call
cancelFunc
of the connection. But callcancelFunc
will make the result be uncertainty to client.So just close the connections and return error.
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes
This change is