morph: Introduce switch rpc guarded rpc actor #925
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#925
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-node:fix/rpc-actor-guard"
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?
to prevent using invalidated rpc actor when RPC switch
happens.
0f7b10552f
to64882a61ee
@ -0,0 +18,4 @@
// it when it is already invalidated. SwitchRPCGuardedActor is used to prevent
// this situation, getting the rpc actor from Client.
type SwitchRPCGuardedActor struct {
actorProvider actorProvider
The constructor accepts
*Client
, but we useactorProvider
in field.Why not use
*Client
in struct too?I think this really makes sense because it is better to make programmer prevent using recursive calls (
cli.switchRPCGuardedActor.client.switchRPCGuardedActor.client....
)@ -157,6 +157,8 @@ func New(ctx context.Context, key *keys.PrivateKey, opts ...Option) (*Client, er
}
cli.setActor(act)
cli.switchRPCGuardedActor = NewSwitchRPCGuardedActor(cli)
We use it only to provide it to APE storage. Do we need to store this field here? I mean we can always call
NewSwitchRPCGuardedActor(cli)
if we have clientGood point
Other than comments, LGTM
64882a61ee
to42859fd920