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

binder: BinderClientTransport should eventually give up waiting for a connection #11137

Closed
jdcormie opened this issue Apr 30, 2024 · 0 comments · Fixed by #11255
Closed

binder: BinderClientTransport should eventually give up waiting for a connection #11137

jdcormie opened this issue Apr 30, 2024 · 0 comments · Fixed by #11255

Comments

@jdcormie
Copy link
Member

Is your feature request related to a problem?

Yes. Android automatically restarts gRPC/binder servers that crash, with a delay (source). This is generally a good thing -- in-flight calls fail and clients can choose to retry them. But a gRPC/binder server that repeatedly crashes on startup, before onBind() can complete (for example due to corrupt persistent state) can cause very long connection delays on the client. From ServiceBinding's perspective, this looks like a bindService() call that succeeds but no ServiceConnection callback is ever invoked. Without a report of transport failure, the Channel never moves to state TRANSIENT_FAILURE and the usual NameResolver/LoadBalancer machinery doesn't get a chance to try a different address. The waitForReady() call option has no real effect.

Describe the solution you'd like

Use a timer to report transportShutdown()/transportTerminated() if onServiceConnected() isn't called back within some user configurable duration.

Describe alternatives you've considered

Do nothing, trust Android to decide whether to ever give up, and rely on clients to set a deadline on each call.

@ejona86 ejona86 added this to the Next milestone May 1, 2024
jdcormie added a commit that referenced this issue Jun 5, 2024
Timeout is initially infinite so that we can release/import the supporting code and the behavior change independently.

Fixes #11137
@ejona86 ejona86 modified the milestones: Next, 1.65 Jun 6, 2024
jdcormie added a commit that referenced this issue Jul 9, 2024
larry-safran pushed a commit to larry-safran/grpc-java that referenced this issue Aug 13, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants