You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/07/06 12:20:26 UTC

[GitHub] [pulsar-client-go] liangyuanpeng opened a new pull request #309: [Issue 306] Change connection failed warn log to error and print error message

liangyuanpeng opened a new pull request #309:
URL: https://github.com/apache/pulsar-client-go/pull/309


   <--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull request.
       Skip *component* if you are unsure about which is the best component. E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   *(If this PR fixes a github issue, please add `Fixes #<xyz>`.)*
   
   Fixes #306 
   
   *(or if this PR is one task of a github issue, please add `Master Issue: #<xyz>` to link to the master issue.)*
   
   Master Issue: #<xyz>
   
   ### Motivation
   
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve.*
   
   ### Modifications
   
   Print clean log when connection failed.
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API: (yes / no)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / GoDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] liangyuanpeng commented on a change in pull request #309: [Issue 306] Change connection failed warn log to error and print error message

Posted by GitBox <gi...@apache.org>.
liangyuanpeng commented on a change in pull request #309:
URL: https://github.com/apache/pulsar-client-go/pull/309#discussion_r450264416



##########
File path: pulsar/internal/connection.go
##########
@@ -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'",

Review comment:
       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?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on a change in pull request #309: [Issue 306] Change connection failed warn log to error and print error message

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on a change in pull request #309:
URL: https://github.com/apache/pulsar-client-go/pull/309#discussion_r450227808



##########
File path: pulsar/internal/connection.go
##########
@@ -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'",

Review comment:
       About log level I think `Warnf` is more appropriate, it has not reached the Error level




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] liangyuanpeng commented on a change in pull request #309: [Issue 306] Change connection failed warn log to error and print error message

Posted by GitBox <gi...@apache.org>.
liangyuanpeng commented on a change in pull request #309:
URL: https://github.com/apache/pulsar-client-go/pull/309#discussion_r450264416



##########
File path: pulsar/internal/connection.go
##########
@@ -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'",

Review comment:
       How do we define the error level ? The client can't  working when this error happend and why just got warn log?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] merlimat commented on a change in pull request #309: [Issue 306] Change connection failed warn log to error and print error message

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #309:
URL: https://github.com/apache/pulsar-client-go/pull/309#discussion_r450984529



##########
File path: pulsar/internal/connection.go
##########
@@ -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())

Review comment:
       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'",
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] merlimat commented on a change in pull request #309: [Issue 306] Change connection failed warn log to error and print error message

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #309:
URL: https://github.com/apache/pulsar-client-go/pull/309#discussion_r450452438



##########
File path: pulsar/internal/connection.go
##########
@@ -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'",

Review comment:
       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`. 
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] liangyuanpeng commented on a change in pull request #309: [Issue 306] Change connection failed warn log to error and print error message

Posted by GitBox <gi...@apache.org>.
liangyuanpeng commented on a change in pull request #309:
URL: https://github.com/apache/pulsar-client-go/pull/309#discussion_r450264416



##########
File path: pulsar/internal/connection.go
##########
@@ -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'",

Review comment:
       How do we define the error level ? The client can't not working when this error happend and why just got warn log?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy merged pull request #309: [Issue 306] Change connection failed warn log to error and print error message

Posted by GitBox <gi...@apache.org>.
wolfstudy merged pull request #309:
URL: https://github.com/apache/pulsar-client-go/pull/309


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org