Skip to content

Commit

Permalink
handle shutdown case
Browse files Browse the repository at this point in the history
Signed-off-by: Nigel Brittain <[email protected]>
  • Loading branch information
nbaws committed Aug 8, 2024
1 parent 43ad96e commit 94bc9a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions source/extensions/common/aws/metadata_fetcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class MetadataFetcherImpl : public MetadataFetcher,
ASSERT(!request_);
complete_ = false;
receiver_ = makeOptRef(receiver);

// Stop processing if we are shutting down
if (cm_.isShutdown()) {
return;
}

const auto thread_local_cluster = cm_.getThreadLocalCluster(cluster_name_);
if (thread_local_cluster == nullptr) {
ENVOY_LOG(error, "{} AWS Metadata failed: [cluster = {}] not found", __func__, cluster_name_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ TEST_F(InitializeFilterTest, TestWithTwoClustersRouteLevelAndStandard) {
}

TEST_F(InitializeFilterTest, TestWithTwoClustersStandardInstanceProfile) {
Envoy::Logger::Registry::setLogLevel(spdlog::level::debug);
dnsSetup();
// Web Identity Credentials, Container Credentials and Instance Profile Credentials
TestEnvironment::setEnvVar("AWS_WEB_IDENTITY_TOKEN_FILE", "/path/to/web_token", 1);
Expand Down

0 comments on commit 94bc9a9

Please sign in to comment.