forked from TrueCloudLab/frostfs-node
[#2080] morph: Close morph clients
Could be related to "websocket users limit reached" on the `neo-go` server side when an SN/IR is rebooting repeatedly. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
3d0768a1d3
commit
c01d4ecb50
3 changed files with 9 additions and 0 deletions
|
@ -153,6 +153,12 @@ func (c *Client) newCli(endpoint string) (*rpcclient.WSClient, *actor.Actor, err
|
|||
return nil, nil, fmt.Errorf("WS client creation: %w", err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
cli.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
err = cli.Init()
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("WS client initialization: %w", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue