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/06/09 16:44:02 UTC

[GitHub] [pulsar-client-go] cckellogg commented on a change in pull request #248: Clean callbacks of connection after run loop stopped (#239)

cckellogg commented on a change in pull request #248:
URL: https://github.com/apache/pulsar-client-go/pull/248#discussion_r437182165



##########
File path: pulsar/internal/connection.go
##########
@@ -656,20 +662,14 @@ func (c *connection) Close() {
 
 	c.log.Info("Connection closed")
 	c.state = connectionClosed
-	if c.cnx != nil {
-		c.cnx.Close()
-	}
+	c.TriggerClose()

Review comment:
       If a client calls this won't it trigger another call to `Close()` if the run loop is still going. This would cause all the listeners to be trigger again. Are there potential issues with that?

##########
File path: pulsar/internal/connection.go
##########
@@ -656,20 +662,14 @@ func (c *connection) Close() {
 
 	c.log.Info("Connection closed")
 	c.state = connectionClosed
-	if c.cnx != nil {
-		c.cnx.Close()
-	}
+	c.TriggerClose()

Review comment:
       If a client calls this won't it trigger another call to `Close()` if the run loop is still going. This would cause all the listeners to be triggered again. Are there potential issues with that?




----------------------------------------------------------------
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