diff --git a/CHANGELOG.md b/CHANGELOG.md index ae5c718ade..f6c63fc7f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pkg/morph/client/multi.go b/pkg/morph/client/multi.go index 1de456ef63..476a2d8edb 100644 --- a/pkg/morph/client/multi.go +++ b/pkg/morph/client/multi.go @@ -64,5 +64,7 @@ func (c *Client) closeWaiter() { case <-c.closeChan: } var conn = c.conn.Swap(nil) - conn.Close() + if conn != nil { + conn.Close() + } } diff --git a/pkg/morph/client/notifications.go b/pkg/morph/client/notifications.go index e370444b30..4e8f326487 100644 --- a/pkg/morph/client/notifications.go +++ b/pkg/morph/client/notifications.go @@ -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