Allow to pass connection to a client #26
Labels
No labels
P0
P1
P2
P3
good first issue
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-api-go#26
Loading…
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?
Client is just an interface on top of some gRPC connection.
Currently, we Dial/Init inside, which makes it impossible to implement some connection pooling. Debugging is also not pleasant, especially if you are a fan of printf-style.
I suggest to allow passing raw
*grpc.ClientConn
as an argument to the client. If it is provided, we use the specified connection and (may be) do not close it.cc @TrueCloudLab/storage-core-committers @TrueCloudLab/storage-core-developers
The gRPC connection itself (namely,
ClientConn
which is a virtual connection) already does pooling, multiplexing and even manages reconnections. Why do we need to do any caching on our side?We already have this https://git.frostfs.info/TrueCloudLab/frostfs-api-go/src/branch/master/rpc/client/options.go#L117
@ale64bit you are right, but AFAIK there is no way to prioritize particular RPCs. Cockroach does sth similar with connections for example
bf25b7bf93/pkg/rpc/connection_class.go (L20)
Another possibility is to have multiple endpoints to the same node.