Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gl-client unrecoverable after network change #521

Open
JssDWt opened this issue Sep 30, 2024 · 3 comments
Open

gl-client unrecoverable after network change #521

JssDWt opened this issue Sep 30, 2024 · 3 comments

Comments

@JssDWt
Copy link
Collaborator

JssDWt commented Sep 30, 2024

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 breez/breez-sdk-greenlight#1090

Unfortunately it seems that tonic's Channel doesn't handle reconnection at all: hyperium/tonic#1254
Meaning reconnection logic should be implemented manually in every client package.

@cdecker
Copy link
Collaborator

cdecker commented Sep 30, 2024

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.

@JssDWt
Copy link
Collaborator Author

JssDWt commented Sep 30, 2024

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.

@JssDWt
Copy link
Collaborator Author

JssDWt commented Sep 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants