-
Notifications
You must be signed in to change notification settings - Fork 28
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
*: filter nil errors #97
Conversation
Signed-off-by: xhe <xw897002528@gmail.com>
@@ -158,11 +158,9 @@ func (s *SQLServer) onConn(ctx context.Context, conn net.Conn) { | |||
|
|||
// Close closes the server. | |||
func (s *SQLServer) Close() error { | |||
var errs []error | |||
errs := make([]error, 0, 4) |
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.
Why 4?
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.
Because there are four managers. So I just give a capacity of four.
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.
I'm afraid you misunderstood the comment. I didn't mean https://github.com/pingcap/TiProxy/blob/2a790039bd1fb7b37b6f2f43ed0d9179f0427bec/pkg/server/server.go#L207-L208
I mean
https://github.com/pingcap/TiProxy/blob/2a790039bd1fb7b37b6f2f43ed0d9179f0427bec/pkg/proxy/proxy.go#L160-L161
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.
It is just a guess of possible connections, giving a larger initial start capacity.
Signed-off-by: xhe xw897002528@gmail.com
What problem does this PR solve?
Issue Number: close None
Problem Summary:
errors.Collect
will filter nil errors automatically, saving you from the tediousif err != nil { errs = append(errs, ..) }
.What is changed and how it works:
Check List
Tests
Notable changes
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.