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

Add Capability to Override Base Timeout for Specific API #698

Open
Adityagaddhyan opened this issue Mar 11, 2024 · 1 comment
Open

Add Capability to Override Base Timeout for Specific API #698

Adityagaddhyan opened this issue Mar 11, 2024 · 1 comment

Comments

@Adityagaddhyan
Copy link

Feature Request: Add Capability to Override Base Timeout for Specific API

I would like to propose a feature that allows us to override the base timeout for a specific API. This would be beneficial in scenarios where certain APIs are expected to take more time, eliminating the need to adjust the timeout for the entire gRPC client.

Proposal:

A possible implementation could involve exposing a method to add a CallOption. We can then adjust timeout.UnaryClientInterceptor to first iterate over the options. If it identifies a specific CallOption for timeout, it would set the context's deadline equal to what's specified in the CallOption, rather than using the global timeout set for the Server.

This feature would mainly enhance the client side experience by offering more flexibility and control over API timeouts.

Looking forward to hearing your thoughts on this proposal.

@johanbrandhorst
Copy link
Collaborator

This is already possible today with gRPC CallOptions, no? If you need per-RPC timeouts, don't use the interceptor that sets it the same for all of them, or use it to set a ceiling and use more specific timeouts for specific calls. I'm very weary of introducing more options to the existing interceptors as it's trivial for users with specific use cases to create their own interceptors and it increases the cognitive load of using the interceptor for new users.

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