rueian commented on a change in pull request #248:
URL: https://github.com/apache/pulsar-client-go/pull/248#discussion_r431291341
##########
File path: pulsar/internal/connection.go
##########
@@ -656,18 +662,20 @@ func (c *connection) Close() {
c.log.Info("Connection closed")
c.state = connectionClosed
- if c.cnx != nil {
- c.cnx.Close()
- }
+ c.TriggerClose()
c.pingTicker.Stop()
c.pingCheckTicker.Stop()
for _, listener := range c.listeners {
listener.ConnectionClosed()
}
- for _, req := range c.pendingReqs {
+ if c.runLoopStoppedCh != nil {
Review comment:
> Do you see the run loop ever getting stuck for a period of time when
close is called?
No, they are separated originally. To keep the original behavior, the
runLoopStoppedCh is not needed if we move the pendingReqs cleanup at the end of
run loop.
I just updated the PR which moves pendingReqs cleanup into the run loop and
adds some notices.
Please let me know if it looks good to you.
----------------------------------------------------------------
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:
[email protected]