Skip to content

Commit

Permalink
morph: fix nil pointer dereferencing to connection (#3073)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov authored Dec 27, 2024
2 parents fb304b4 + 48d09ab commit 08bd8d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changelog for NeoFS Node
### Fixed
- `neofs-cli object delete` command output (#3056)
- Make the error message more clearer when validating IR configuration (#3072)
- Panic during shutdown if N3 client connection is lost (#3073)

### Changed
- Number of cuncurrenly handled notifications from the chain was increased from 10 to 300 for IR (#3068)
Expand Down
4 changes: 3 additions & 1 deletion pkg/morph/client/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@ func (c *Client) closeWaiter() {
case <-c.closeChan:
}
var conn = c.conn.Swap(nil)
conn.Close()
if conn != nil {
conn.Close()
}
}
3 changes: 3 additions & 0 deletions pkg/morph/client/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ routeloop:
if conn == nil {
c.logger.Info("RPC connection lost, attempting reconnect")
conn = c.switchRPC()
if conn == nil {
break routeloop
}
go c.restoreSubscriptions(conn, restoreCh)
}
var connLost bool
Expand Down

0 comments on commit 08bd8d3

Please sign in to comment.