client: (*Client).Dial
seems to be redundant #308
Labels
No labels
P0
P1
P2
P3
good first issue
pool
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-go#308
Loading…
Add table
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?
Is your feature request related to a problem? Please describe.
After incorporating the approach from #304, I think we should consider whether we still need the Dial method.
_, err := rpc.Balance(&c.c, new(v2accounting.BalanceRequest),
client.WithContext(ctx),
)
Currently, we use this method to check if the target node is alive before making a request. As far as I know, it was another way to cope with the lack of distinction between the dialing and streaming steps. After #304 is merged, the previous approach seems to be redundant.
Examples of its usage in
frostfs-node
:c.Init(prmInit)
err := c.Dial(ctx, prmDial)
c.Init(prmInit)
if err := c.Dial(ctx, prmDial); err != nil {
Describe the solution you'd like
Get rid of
(*Client).Dial
Describe alternatives you've considered
Keep things as they are
client:to client:(c *Client) Dial
seems to be redundant(*Client) Dial
seems to be redundantclient:to client:(*Client) Dial
seems to be redundant(*Client).Dial
seems to be redundantDial
is used in frostfs-node's multiclient within createForAddress.The problem is that you can't just remove healthchecking part (equals to
rpc.Balance(...)
) fromDial
. This may break the client caching within multiclient as you will "healthcheck" it in lazy manner. Here it comes:Dial
->createForAddress
always returns a clientc.lastAttempt = time.Now()
. Although the problem may hide and get disclosed after any RPC-callc.lastAttempt = time.Now()
-> noerrRecentlyFailed
(at all ???)So, we should consider this point before erasing
Dial