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 2021/02/28 17:05:13 UTC

[GitHub] [pulsar-client-go] PowerStateFailure commented on a change in pull request #473: Fix infinite loop in connection.failLeftRequestsWhenClose

PowerStateFailure commented on a change in pull request #473:
URL: https://github.com/apache/pulsar-client-go/pull/473#discussion_r584326333



##########
File path: pulsar/internal/connection.go
##########
@@ -331,10 +331,10 @@ func (c *connection) waitUntilReady() error {
 }
 
 func (c *connection) failLeftRequestsWhenClose() {
+	close(c.incomingRequestsCh)

Review comment:
       You're right, it may cause panic in `SendRequest`/`SendRequestNoWait` since channel state check and `incomingRequestsCh` is both not atomic.
   As a dirty workaround i've added double check before write to `incomingRequestsCh` by ensuring `closeCh` not closed yet - see next commit




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