From 30c7925b3c4ce1a41bde71d732b2b576e127f9a5 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 21 Jul 2022 13:38:41 +0300 Subject: [PATCH] [#1609] morph/client: Retry connecting to failed endpoint during the switch Signed-off-by: Evgenii Stratonikov --- CHANGELOG.md | 1 + pkg/morph/client/multi.go | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e930e1140..56310cb408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Changelog for NeoFS Node - Require SG members to be unique (#1490) - `neofs-cli` now doesn't remove container with LOCK objects without `--force` flag (#1500) - `morph` sections in IR and storage node configuration now accept an address and a priority of an endpoint (#1609) +- Morph client now retries connecting to the failed endpoint too (#1609) ### Fixed diff --git a/pkg/morph/client/multi.go b/pkg/morph/client/multi.go index e72a3915b1..0a5d8dc69d 100644 --- a/pkg/morph/client/multi.go +++ b/pkg/morph/client/multi.go @@ -34,12 +34,7 @@ func (c *Client) switchRPC() bool { // Iterate endpoints in the order of decreasing priority. // Skip the current endpoint. - last := c.endpoints.curr for c.endpoints.curr = range c.endpoints.list { - if c.endpoints.curr == last { - continue - } - newEndpoint := c.endpoints.list[c.endpoints.curr].Address cli, err := newWSClient(c.cfg, newEndpoint) if err != nil {