mirror of
https://github.com/nspcc-dev/neofs-node.git
synced 2026-03-01 04:29:10 +00:00
Use the same endpoint for notifications and RPC requests #394
Labels
No labels
I1
I2
I3
I4
S0
S1
S2
S3
S4
U0
U1
U2
U3
U4
blocked
bug
config
dependencies
discussion
documentation
enhancement
enhancement
epic
feature
go
good first issue
help wanted
neofs-adm
neofs-cli
neofs-cli
neofs-cli
neofs-ir
neofs-lens
neofs-storage
neofs-storage
performance
question
security
task
test
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-node#394
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alexvanin on GitHub (Dec 24, 2021).
Originally assigned to: @carpawell on GitHub.
NeoFS nodes have two separate pools of endpoint addresses:
Node might listen events from one endpoint but send RPC request to another. There is an issue with that approach.
Sidechain blocks are not distributed uniformly among RPC nodes. There is a case when NeoFS node receives notification from block which is not processed by other RPC node, where NeoFS sends requests.
Example:
nspcc-dev/neofs-node@96efe0f294/cmd/neofs-node/netmap.go (L144-L157)In this example NeoFS node tries to fetch new network map on
NewEpochevent. If RPC node did not process block with new epoch yet, then fetch invocation will fail and new network map will not be processed by the node.To avoid such cases I propose to use single endpoint for listening and sending events. In case of errors, switch to another endpoint both in listener and in the client.
WSClient encapsulates ordinary client that we use in morph package.
Drop multiclient component from RPC
Provide seamless switch from one endpoint to another in runtime
In case of network errors during RPC requests or closed channel in subscriber, switch to another endpoint.
@alexvanin commented on GitHub (Jan 18, 2022):
I propose to do it in two steps.
Use single pool of endpoints in config to fetch one web socket address for one client and one listener. In case of failures, do not anything. This kinda reverts https://github.com/nspcc-dev/neofs-node/issues/746
Define components that will implement both
Listenerinterface and necessary neo-go client functions. This component will use monitor routine to check health of nodes and switch between endpoints in case of failures like https://github.com/nspcc-dev/neofs-node/issues/746.