Skip to content

Commit

Permalink
[xDS-enabled server] fix status code when RDS resource doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
markdroth committed Dec 12, 2024
1 parent f36c6ae commit d852c28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/server/xds_server_config_fetcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
}
}
state.rds_update =
absl::NotFoundError("Requested route config does not exist");
absl::UnavailableError("Requested route config does not exist");
}
// Promote the filter chain match manager object if all the referenced
// resources are fetched.
Expand Down Expand Up @@ -1342,7 +1342,7 @@ void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
DynamicXdsServerConfigSelectorProvider::OnResourceDoesNotExist() {
MutexLock lock(&mu_);
resource_ = absl::NotFoundError("Requested route config does not exist");
resource_ = absl::UnavailableError("Requested route config does not exist");
if (watcher_ == nullptr) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/end2end/xds/xds_end2end_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,7 @@ TEST_P(XdsServerRdsTest, NonInlineRouteConfigurationNotAvailable) {
ASSERT_TRUE(backends_[0]->notifier()->WaitOnServingStatusChange(
grpc_core::LocalIpAndPort(backends_[0]->port()), grpc::StatusCode::OK));
SendRpc([this]() { return CreateInsecureChannel(); }, RpcOptions(), {}, {},
true /* test_expects_failure */, grpc::StatusCode::NOT_FOUND,
true /* test_expects_failure */, grpc::StatusCode::UNAVAILABLE,
"Requested route config does not exist");
}

Expand Down

0 comments on commit d852c28

Please sign in to comment.