-
Notifications
You must be signed in to change notification settings - Fork 336
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
[Issue 306] Change connection failed warn log to error and print error message #309
Conversation
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.
The change LGTM+1, just a little comment, please fix them.
pulsar/internal/connection.go
Outdated
@@ -287,8 +287,8 @@ func (c *connection) doHandshake() bool { | |||
c.cnx.SetDeadline(time.Time{}) | |||
|
|||
if cmd.Connected == nil { | |||
c.log.Warnf("Failed to perform initial handshake - Expecting 'Connected' cmd, got '%s'", | |||
cmd.Type) | |||
c.log.Errorf("Failed to perform initial handshake - Expecting 'Connected' cmd, got '%s'", |
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.
About log level I think Warnf
is more appropriate, it has not reached the Error level
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.
Thanks for your code review!
How do we define the error level ? The client can't working when this error happend and why just got warn log?
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.
The message itself need to be changed though. It was basically a "debug" message. In this case, the user doesn't know what's a Connected cmd
.
@@ -288,7 +288,7 @@ func (c *connection) doHandshake() bool { | |||
|
|||
if cmd.Connected == nil { | |||
c.log.Warnf("Failed to perform initial handshake - Expecting 'Connected' cmd, got '%s'", | |||
cmd.Type) | |||
cmd.Error.GetMessage()) |
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.
Please change the original message since with this change it wouldn't make sense anymore:
c.log.Warnf("Failed to establish connection with broker: '%s'",
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 +1
Fixes #306
Motivation
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications
Print a clean log when the connection failed.