-
Notifications
You must be signed in to change notification settings - Fork 719
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/conn: remove EOF log #432
Conversation
If the pd leader steps down, it will also close all connections, what's the error here? do we need to ignore it too? |
Any update? |
f1e689d
to
ff74dd1
Compare
If a connection is closed, the error will be "use of closed network connection". |
if errors.Cause(err) == io.EOF { | ||
return false | ||
} | ||
if strings.Contains(err.Error(), "use of closed network connection") { |
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 you can check the err is net.Error instead.
It's better not to check the error message directly.
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.
But we only want to ignore this specified error, not all of the net.Error
.
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.
define a const var for the error message.
add test to cover this function.
LGTM |
PTAL @overvenus |
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
EOF means the remote peer closes the connection actively, seems not a server error, we don't need to log it as error to confuse users.