From ecbe3fdd8631ed978914547777bd7caa84dcac3a Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Tue, 26 Dec 2023 14:44:02 -0800 Subject: [PATCH] fixup: init reading the ADS stream in LRS --- src/core/ext/xds/xds_client.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/ext/xds/xds_client.cc b/src/core/ext/xds/xds_client.cc index d0edfa988f5d9..cc4dd5f0f875f 100644 --- a/src/core/ext/xds/xds_client.cc +++ b/src/core/ext/xds/xds_client.cc @@ -1371,6 +1371,7 @@ XdsClient::ChannelState::LrsCallState::LrsCallState( std::string serialized_payload = xds_client()->api_.CreateLrsInitialRequest(); call_->SendMessage(std::move(serialized_payload)); send_message_pending_ = true; + call_->StartRecvMessage(); } void XdsClient::ChannelState::LrsCallState::Orphan() { @@ -1419,11 +1420,11 @@ void XdsClient::ChannelState::LrsCallState::OnRequestSent(bool /*ok*/) { void XdsClient::ChannelState::LrsCallState::OnRecvMessage( absl::string_view payload) { MutexLock lock(&xds_client()->mu_); - // If we're no longer the current call, ignore the result. - if (!IsCurrentCallOnChannel()) return; // Start recv after any code branch auto cleanup = absl::MakeCleanup([call = call_.get()]() { call->StartRecvMessage(); }); + // If we're no longer the current call, ignore the result. + if (!IsCurrentCallOnChannel()) return; // Parse the response. bool send_all_clusters = false; std::set new_cluster_names;