Skip to content

Commit

Permalink
morph: drop inactive client mode, fix #2797
Browse files Browse the repository at this point in the history
Reconnect indefinitely. After the initial probe this should be the behavior
for client, we can not work without blockchain data so we must wait for it as
long as needed, not entering any "inactive" state where the node pretends to
be alive, but can't do anything.

This makes client context (including everything belonging to it) an atomically
updated thing, regular calls fetch it when needed and can break if there are no
current connection. Meanwhile notification processing thread can reconnect when
needed and restore functionality.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
  • Loading branch information
roman-khimov committed Nov 2, 2024
1 parent 70cd3af commit 5ec3d5a
Show file tree
Hide file tree
Showing 10 changed files with 348 additions and 458 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ attribute, which is used for container domain name in NNS contracts (#2954)
- Structure table in the SN-configuration document (#2974)
- False negative connection to NeoFS chain in multi-endpoint setup with at least one live node (#2986)
- Overriding the default container and object attributes only with the appropriate flags (#2985)
- RPC client reconnection failures leading to complete SN failure (#2797)

### Changed
- `ObjectService`'s `Put` RPC handler caches up to 10K lists of per-object sorted container nodes (#2901)
Expand Down
3 changes: 0 additions & 3 deletions cmd/neofs-node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,6 @@ func initBasics(c *cfg, key *keys.PrivateKey, stateStorage *state.PersistentStor
c.internalErr <- fmt.Errorf("restarting after morph connection was lost: %w", err)
}
}),
client.WithConnLostCallback(func() {
c.internalErr <- errors.New("morph connection has been lost")
}),
client.WithMinRequiredBlockHeight(fromSideChainBlock),
)
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions pkg/innerring/innerring.go
Original file line number Diff line number Diff line change
Expand Up @@ -1077,9 +1077,6 @@ func (s *Server) createClient(ctx context.Context, p chainParams, errChan chan<-
errChan <- fmt.Errorf("internal services' restart after RPC reconnection to the %s: %w", p.name, err)
}
}),
client.WithConnLostCallback(func() {
errChan <- fmt.Errorf("%s chain connection has been lost", p.name)
}),
client.WithMinRequiredBlockHeight(p.from),
}
if p.withAutoSidechainScope {
Expand Down
Loading

0 comments on commit 5ec3d5a

Please sign in to comment.