Skip to content

Commit

Permalink
fix conn leak, prepare v0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Sep 4, 2022
1 parent 48abf9e commit afdd3b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v0.9.3
======

* Fix leaking connection when getting `token expired` error upon connect.

v0.9.2
======

Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,7 @@ func (c *Client) startReconnecting() error {
c.mu.Unlock()
if err != nil {
c.handleError(ConnectError{err})
_ = t.Close()
if isTokenExpiredError(err) {
c.mu.Lock()
defer c.mu.Unlock()
Expand All @@ -991,7 +992,6 @@ func (c *Client) startReconnecting() error {
c.mu.Lock()
defer c.mu.Unlock()
if c.state != StateConnecting {
_ = t.Close()
return
}
c.reconnectAttempts++
Expand Down

0 comments on commit afdd3b9

Please sign in to comment.