diff --git a/src/core/ext/filters/logging/logging_filter.cc b/src/core/ext/filters/logging/logging_filter.cc index 561e4718ab3..db02366fee5 100644 --- a/src/core/ext/filters/logging/logging_filter.cc +++ b/src/core/ext/filters/logging/logging_filter.cc @@ -433,13 +433,15 @@ class ClientLoggingFilter final : public ChannelFilter { md.get()); return md; }), - [calld]() { + // TODO(yashykt/ctiller): GetContext is not + // valid for the cancellation function requiring us to capture it here. + // This ought to be easy to fix once client side promises are completely + // rolled out. + [calld, ctx = GetContext()]() { calld->LogCancel( /*is_client=*/true, static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value)); + ctx[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value)); }); }