Server Stream RPC and server-side Interceptors

16 views
Skip to first unread message

Frederick Brier

unread,
Feb 17, 2021, 12:46:13 PMFeb 17
to grpc.io
When making a streaming RPC call, the client returns immediately, before the server-side interceptor is executed. The interceptor is doing a security check and would throw an RpcException prior to calling the continuation. What event occurs that could be hooked or detected to allow the client to know it has passed the initial security check? The ResponseHeadersAsync task does not appear to complete until the stream is closed. Thank you.

Jan Tattermusch

unread,
Feb 22, 2021, 8:59:21 AMFeb 22
to grpc.io
The behavior you're describing is odd. The ResponseHeaderAsync  metadata is something the client should be able to receive as soon as the server writes them (without needing to wait for the entire call to finish or receiving any responses from the server). The way to force sending the response headers on the server is by invoking serverCallContext.WriteResponseHeadersAsync() (if you don't force sending the response headers explicitly, 
they will be sent along with the first response sent by server).
Reply all
Reply to author
Forward
0 new messages