[RegisteredMethod] Set information on initial metadata about whether method is registered or not (#34432)
Summary - On the server-side, we are changing the point at which we decide whether a method is registered or not from the surface to the transport at the point where we are done receiving initial metadata and before we invoke the recv_initial_metadata_ready closures from the filters. The main motivation for this is to allow filters to check whether the incoming method is a registered or not. The exact use-case is for observability where we only want to record the method if it is registered. We store the information about the registered method in the initial metadata. On the client-side, we also set information about whether the method is registered or not in the outgoing initial metadata. Since we are effectively changing the lookup point of the registered method, there are slight concerns of this being a potentially breaking change, so we are guarding this with an experiment to be safe. Changes - * Transport API changes - * Along with `accept_stream_fn`, a new callback `registered_method_matcher_cb` will be sent down as a transport op on the server side. When initial metadata is received on the server side, this callback is invoked. This happens before invoking the `recv_initial_metadata_ready` closure. * Metadata changes - * We add a new non-serializable metadata trait `GrpcRegisteredMethod()`. On the client-side, the value is a uintptr_t with a value of 1 if the call has a registered/known method, or 0, if it's not known. On the server side, the value is a (ChannelRegisteredMethod*). This metadata information can be used throughout the stack to check whether a call is registered or not. * Server Changes - * When a new transport connection is accepted, the server sets `registered_method_matcher_cb` along with `accept_stream_fn`. This function checks whether the method is registered or not and sets the RegisteredMethod matcher in the metadata for use later. * Client Changes - * Set the metadata on call creation on whether the method is registered or not.pull/34454/head
parent
2f78fffa37
commit
06b55bdaa4
19 changed files with 162 additions and 13 deletions
Loading…
Reference in new issue