You should always call close, except if it has already been closed. You can tell if a downstream interceptor has called close because you will get back an onCancel or onComplete callback from the ServerCall.Listener you get back from ServerCallHandler.startCall.
On Monday, October 30, 2017 at 2:18:52 PM UTC-7, John Hume wrote: > > We have a ServerInterceptor for logging every call our grpc-java server > receives. It wraps the ServerCall passed on to next::startCall with a > SimpleForwardingServerCall that overrides close(Status,Metadata) for > logging the status of the call and tracking total time elapsed between > interceptCall and close. We expected this to result in logging status and > tracking elapsed time for every call received. > > We've found one case in production where our interceptor logged in the > body of interceptCall, and then an inner interceptor did some logging in > its interceptCall, but we never saw any more logging for the request. Other > context suggests that there were connection issues between the client and > server at the time. > > Should ServerCall::close(Status,Metadata) be called for every call, > regardless of client or connection misbehavior? If not, is there some other > callback that we may have missed that would indicate that a call has died? > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/99edd3e6-6ce5-467f-bb8a-4c5a69867534%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
