Merge pull request #23863 from donnadionne/TF

Fixing the transient failure that occurs during the case where
pull/23898/head
donnadionne 5 years ago committed by GitHub
commit ffb643479c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/core/ext/xds/xds_client.cc
  2. 1
      test/cpp/end2end/xds_end2end_test.cc

@ -1022,6 +1022,13 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
const std::string& cluster_name = p.first;
if (cds_update_map.find(cluster_name) == cds_update_map.end()) {
ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
// If the resource was newly requested but has not yet been received,
// we don't want to generate an error for the watchers, because this CDS
// response may be in reaction to an earlier request that did not yet
// request the new resource, so its absence from the response does not
// necessarily indicate that the resource does not exist.
// For that case, we rely on the request timeout instead.
if (!cluster_state.update.has_value()) continue;
cluster_state.update.reset();
for (const auto& p : cluster_state.watchers) {
p.first->OnResourceDoesNotExist();

@ -1545,6 +1545,7 @@ class XdsEnd2endTest : public ::testing::TestWithParam<TestType> {
"Performed %d warm up requests against the backends. "
"%d succeeded, %d failed, %d dropped.",
num_total, num_ok, num_failure, num_drops);
EXPECT_EQ(num_failure, 0);
return std::make_tuple(num_ok, num_failure, num_drops);
}

Loading…
Cancel
Save