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

Move gRPC server deadline filter, allow custom insertion order #2421

Merged
merged 8 commits into from
Nov 15, 2022

Conversation

Scottmitch
Copy link
Member

Motivation:
The default insertion order for gRPC deadline filter is after user filters. If a user's filter deadlocks the timeout will never be applied.

Some use cases may necessitate applying the deadline timeout filter in a custom order (e.g. relative to retries). There is currently no way to customize the append ordering.

Modifications:

  • Move the gRPC server deadline filter to the beginning of the filter chain so timeouts are applied regardless if user filter code hangs.
  • Add appendTimeoutFilter method to gRPC client and server builder to give users control over filter append ordering.
  • Introduce GrpcFilters utility class to create the filters that apply deadline propagation.

@Scottmitch Scottmitch force-pushed the grpc_deadline_filter branch 2 times, most recently from 47c6275 to a6a17b2 Compare November 12, 2022 19:34
@Scottmitch
Copy link
Member Author

PR depends upon #2422 (for consistent error codes return when client times out)

Motivation:
The default insertion order for gRPC deadline filter is after
user filters. If a user's filter deadlocks the timeout will
never be applied.

Some use cases may necessitate applying the deadline timeout
filter in a custom order (e.g. relative to retries). There
is currently no way to customize the append ordering.

Modifications:
- Move the gRPC server deadline filter to the beginning of the
  filter chain so timeouts are applied regardless if user filter
  code hangs.
- Add appendTimeoutFilter method to gRPC client and server builder
  to give users control over filter append ordering.
- Introduce GrpcFilters utility class to create the filters that
  apply deadline propagation.
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀
Thank you for taking care of this!

@Scottmitch Scottmitch merged commit 9d0e9ce into apple:main Nov 15, 2022
@Scottmitch Scottmitch deleted the grpc_deadline_filter branch November 15, 2022 04:12
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

Successfully merging this pull request may close these issues.

2 participants