Skip to content

Commit

Permalink
[call-v3] Add a hook to deadline filter (grpc#35252)
Browse files Browse the repository at this point in the history
Still need to figure a better long term strategy here, but this 'works for now'

Closes grpc#35252

COPYBARA_INTEGRATE_REVIEW=grpc#35252 from ctiller:cg-deadline a413955
PiperOrigin-RevId: 588980941
  • Loading branch information
ctiller authored and copybara-github committed Dec 8, 2023
1 parent 25c2982 commit 257efc0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/core/ext/filters/deadline/deadline_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,17 @@ const grpc_channel_filter grpc_server_deadline_filter = {
}
return next_promise_factory(std::move(call_args));
},
/* init_call: */ nullptr,
[](grpc_channel_element*, grpc_core::CallSpineInterface* spine) {
spine->client_initial_metadata().receiver.InterceptAndMap(
[](grpc_core::ClientMetadataHandle md) {
auto deadline = md->get(grpc_core::GrpcTimeoutMetadata());
if (deadline.has_value()) {
grpc_core::GetContext<grpc_core::CallContext>()->UpdateDeadline(
*deadline);
}
return md;
});
},
grpc_channel_next_op,
sizeof(server_call_data),
deadline_init_call_elem,
Expand Down

0 comments on commit 257efc0

Please sign in to comment.