-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Android grpc with UDS is slow to connect sometimes #11442
Comments
I believe we were able to resolve this issue by providing our own dummy |
Our workaround for this issue: mullvad/mullvadvpn-app#6567 |
We believe this issue might be because the default UdsChannelBuilder returns a url with a |
Localhost isn't resolved locally on Android? That's suspicious and surprising. But we could use |
@ejona86 Well it is kind of weird that a DNS request would happen at all right? We are using UDS, there is no DNS to resolve. |
The current approach is a hack until the unix address negotiation is implemented. Yes, long-term there would be a unix name resolver, and it'd return unix addresses, and that'd select the okhttp unix-supporting transport, and there'd be no DNS. Right now the result from the name resolver is thrown away. Doing "DNS" for "localhost" was supposed to be a local lookup that did no actual I/O; it calls get getaddrinfo but libc was not expected to do DNS. |
This avoids a DNS lookup, which can be slow and fail. Fixes grpc#11442
This avoids a DNS lookup, which can be slow and fail. Fixes grpc#11442
Hello!
We are using gRPC with Unix Domain Socket (UDS) on android. We are using
waitForReady()
and are bring our gRPC server up when app is active. However, sometimes when opening the app the connection is slow. It seems like some back off is applied unnecessarily. When enabling logging we've come to see the messages below. Connecting can take anywhere from a few 100 ms to 30+ seconds, but usually 0-3 seconds.We've tried using the
channel.resetConnectBackoff()
before trying to connect again, and alsochannel.enterIdle()
before exiting the app w/o any improvement.What version of gRPC-Java are you using?
Latest (
1.65.1
)What is your environment?
Android
What did you expect to see?
Connecting and then Ready state.
What did you see instead?
Connecting, sometimes TransientFailure and then Ready.
We also see the following message, sometimes multiple times (=reconnecting with backoff?).
Steps to reproduce the bug
Setup gRPC with Android using Unix Domain Socket and then open/close app.
The text was updated successfully, but these errors were encountered: