Open JssDWt opened 6 hours ago
Thanks @JssDWt I was unaware that tonic
does not handle reconnections well. Do you have an idea we could use to detect and remedy such a system? I guess you have more experience dealing with flaky connections on the mobile side than we do.
Do you have an idea we could use to detect and remedy such a system? I guess you have more experience dealing with flaky connections on the mobile side than we do.
We've been using golang grpc bindings in breezmobile, where reconnection is handled automatically by the grpc library. I'm looking into possible solutions.
An idea is to use the timeout to detect hanging network connections. Problem is that it may be very slow, currently 10 minutes. We could use a lower timeout like this: https://github.com/hyperium/tonic/pull/662/files#diff-2dc4a5ebbcd9a8a198e55baa6958f271c1df257a9e3d6ae9c70295a4df7773deR133
And then manually reconnect whenever that timeout is hit.
Whenever there's a network change, like switching from wifi to mobile data, gl-client is unable to reconnect to greenlight using the same grpc channel. This means an app using gl-client would have to be killed and restarted to recover.
Related Breez SDK issue here https://github.com/breez/breez-sdk-greenlight/issues/1090
Unfortunately it seems that tonic's
Channel
doesn't handle reconnection at all: https://github.com/hyperium/tonic/issues/1254 Meaning reconnection logic should be implemented manually in every client package.