You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2021/04/21 00:20:25 UTC

[pulsar-client-go] branch master updated: fix leak error (#499)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new eebdab8  fix leak error (#499)
eebdab8 is described below

commit eebdab861ac67135a3057ec85a23935fc58b0dbe
Author: godchen <qi...@zilliz.com>
AuthorDate: Wed Apr 21 08:20:16 2021 +0800

    fix leak error (#499)
    
    Signed-off-by: godchen0212 <qi...@zilliz.com>
---
 pulsar/internal/connection.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pulsar/internal/connection.go b/pulsar/internal/connection.go
index 433c8a8..1c264c6 100644
--- a/pulsar/internal/connection.go
+++ b/pulsar/internal/connection.go
@@ -331,8 +331,9 @@ func (c *connection) waitUntilReady() error {
 }
 
 func (c *connection) failLeftRequestsWhenClose() {
-	for req := range c.incomingRequestsCh {
-		c.internalSendRequest(req)
+	reqLen := len(c.incomingRequestsCh)
+	for i := 0; i < reqLen; i++ {
+		c.internalSendRequest(<-c.incomingRequestsCh)
 	}
 	close(c.incomingRequestsCh)
 }