drpc icon indicating copy to clipboard operation
drpc copied to clipboard

Reconnect client to server

Open spacecodewor opened this issue 2 years ago • 2 comments

Hello everyone, I ran into a reconnect problem, if the server crashes in a panic and recovers, the client via tcp, of course, cannot reach it, except for creating a new client, I did not find a way to solve the problem. Maybe someone has a ready-made reconnect practice in the background?

spacecodewor avatar Jul 28 '22 09:07 spacecodewor

yes, same question for me, especially in case of the drpc server restart

zzycn003 avatar Aug 10 '22 10:08 zzycn003

Indeed, the transport layer is intentionally without many features and designed to allow you to bring your own. I think a connection pool should help with this problem. https://pkg.go.dev/go.bryk.io/pkg/net/drpc is a community package that has a connection pool as part of it. https://pkg.go.dev/storj.io/common/rpc/rpcpool is the one storj uses that is more tailored to it's use case (the cache key contains tls connection state.)

zeebo avatar Aug 10 '22 14:08 zeebo