Skip to content

Commit

Permalink
before cnx.close, the stat need change to connectionClosing
Browse files Browse the repository at this point in the history
  • Loading branch information
wenbingshen committed Dec 3, 2021
1 parent 7ab9b4c commit e624f23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pulsar/internal/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -858,13 +858,14 @@ func (c *connection) Close() {
c.Lock()
cnx := c.cnx
c.Unlock()
c.changeState(connectionClosed)
c.changeState(connectionClosing)

if cnx != nil {
_ = cnx.Close()
}

close(c.closeCh)
c.changeState(connectionClosed)

listeners := make(map[uint64]ConnectionListener)
c.listenersLock.Lock()
Expand Down

0 comments on commit e624f23

Please sign in to comment.