[RetryFilter] Copy the SliceBuffer from RetryFilter's cache to batch payload (#38069)

Fix https://github.com/grpc/grpc/issues/37742.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #38069

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38069 from yijiem:37742 064c437b8d
PiperOrigin-RevId: 694305299
pull/37993/head
Yijie Ma 2 weeks ago committed by Copybara-Service
parent ff23f446a5
commit 6db0a2e4c2
  1. 4
      src/core/client_channel/retry_filter_legacy_call_data.cc
  2. 2
      src/core/client_channel/retry_filter_legacy_call_data.h

@ -1268,6 +1268,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::OnComplete(
}
if (batch_data->batch_.send_message) {
++call_attempt->completed_send_message_count_;
call_attempt->send_message_.Clear();
}
if (batch_data->batch_.send_trailing_metadata) {
call_attempt->completed_send_trailing_metadata_ = true;
@ -1348,7 +1349,8 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
calld->send_messages_[call_attempt_->started_send_message_count_];
++call_attempt_->started_send_message_count_;
batch_.send_message = true;
batch_.payload->send_message.send_message = cache.slices;
call_attempt_->send_message_ = cache.slices->Copy();
batch_.payload->send_message.send_message = &call_attempt_->send_message_;
batch_.payload->send_message.flags = cache.flags;
}

@ -263,6 +263,8 @@ class RetryFilter::LegacyCallData final {
grpc_transport_stream_op_batch_payload batch_payload_;
// For send_initial_metadata.
grpc_metadata_batch send_initial_metadata_;
// For send_message.
SliceBuffer send_message_;
// For send_trailing_metadata.
grpc_metadata_batch send_trailing_metadata_;
// For intercepting recv_initial_metadata.

Loading…
Cancel
Save