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 <[email protected]>
AuthorDate: Wed Apr 21 08:20:16 2021 +0800

    fix leak error (#499)
    
    Signed-off-by: godchen0212 <[email protected]>
---
 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)
 }

Reply via email to