forked from TrueCloudLab/frostfs-node
[#1560] morph/client: Perform RPC switch and restore in one step
Otherwise we could switch infinitely if subscription restore has failed. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
6358f4d746
commit
0ccea802e9
4 changed files with 25 additions and 31 deletions
|
@ -54,9 +54,11 @@ type Client struct {
|
|||
|
||||
cfg cfg
|
||||
|
||||
endpoints *endpoints
|
||||
endpoints endpoints
|
||||
|
||||
// switching between rpc endpoint lock
|
||||
// switchLock protects endpoints, inactive, and subscription-related fields.
|
||||
// It is taken exclusively during endpoint switch and locked in shared mode
|
||||
// on every normal call.
|
||||
switchLock *sync.RWMutex
|
||||
|
||||
// channel for ws notifications
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue