Skip to content

Commit

Permalink
fix: release pending requests when the connection is close
Browse files Browse the repository at this point in the history
  • Loading branch information
nodece committed Aug 8, 2024
1 parent 745536b commit 4359d31
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pulsar/internal/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,13 @@ func (c *connection) Close() {

close(c.closeCh)

c.pendingLock.Lock()
for id, req := range c.pendingReqs {
delete(c.pendingReqs, id)
req.callback(nil, errors.New("connection closed"))
}
c.pendingLock.Unlock()

listeners := make(map[uint64]ConnectionListener)
c.listenersLock.Lock()
for id, listener := range c.listeners {
Expand Down

0 comments on commit 4359d31

Please sign in to comment.