-
Notifications
You must be signed in to change notification settings - Fork 425
ServerInterceptorContext should provide closeFuture similar to ServerCallContext #1552
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
Labels
kind/enhancement
Improvements to existing feature.
Comments
glbrntt
added a commit
to glbrntt/grpc-swift
that referenced
this issue
Jan 11, 2023
Motivation: Server calls expose a `closeFuture` where users can register callbacks to tear things down when the RPC ends. Interceptors don't have this capability and must rely on observing an `.end`. Modifications: Expose the `closeFuture` from `ServerCallContext` to the `ServerInterceptorContext`. Result: - Users can be notified in interceptors when the call ends. - Resolves grpc#1552
glbrntt
added a commit
that referenced
this issue
Jan 11, 2023
Motivation: Server calls expose a `closeFuture` where users can register callbacks to tear things down when the RPC ends. Interceptors don't have this capability and must rely on observing an `.end`. Modifications: Expose the `closeFuture` from `ServerCallContext` to the `ServerInterceptorContext`. Result: - Users can be notified in interceptors when the call ends. - Resolves #1552
WendellXY
pushed a commit
to sundayfun/grpc-swift
that referenced
this issue
Aug 24, 2023
Motivation: Server calls expose a `closeFuture` where users can register callbacks to tear things down when the RPC ends. Interceptors don't have this capability and must rely on observing an `.end`. Modifications: Expose the `closeFuture` from `ServerCallContext` to the `ServerInterceptorContext`. Result: - Users can be notified in interceptors when the call ends. - Resolves grpc#1552
pinlin168
pushed a commit
to sundayfun/grpc-swift
that referenced
this issue
Aug 24, 2023
Motivation: Server calls expose a `closeFuture` where users can register callbacks to tear things down when the RPC ends. Interceptors don't have this capability and must rely on observing an `.end`. Modifications: Expose the `closeFuture` from `ServerCallContext` to the `ServerInterceptorContext`. Result: - Users can be notified in interceptors when the call ends. - Resolves grpc#1552
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe it.
As for today ServerInterceptorContext does not have any way to handle abnormal stream termination (task cancelled, client resets connection in streaming calls).
In such an event interceptor will have no chance to be called as no .end() messages will be passed down ServerInterceptorPipeline.
Result of such behaviour may affect many use cases: tracing (lingering open spans), metrics (some calls will not be recorded), logging (errors will not be logged)
Describe the solution you'd like
Add closeFuture to ServerInterceptorContext (similar to ServerCallContext):
Describe alternatives you've considered
Proposed solution is in line how it currently works for ServerCallContext
Additional context
swift-interceptors.tar.gz
to make client die in bidir route chat
so as a result normal run
and with kill switch
Note no
SEND end
messages (edited)The text was updated successfully, but these errors were encountered: