Skip to content

Commit

Permalink
odcds: log abnormal message in higher level (envoyproxy#37529)
Browse files Browse the repository at this point in the history
The reason that client request can't find the on-demand cluster can be:
1. the on-demand request is not triggered
2. the requested cluster is not found
3. the request timed out

In the previous situation, the log level of failure reason 2/3 is
'debug', which is too low that we can't distinguish the reason via log.
This change increases the log level so that user can troubleshoot the
issue directly.

<!--
!!!ATTENTION!!!

If you are fixing *any* crash or *any* potential security issue, *do
not*
open a pull request in this repo. Please report the issue via emailing
[email protected] where the issue will be triaged
appropriately.
Thank you in advance for helping to keep Envoy secure.

!!!ATTENTION!!!

For an explanation of how to fill out the fields, please see the
relevant section
in
[PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md)
-->

Commit Message: odcds: log abnormal message in higher level
Additional Description:
Risk Level: Low, only log level changed
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

Signed-off-by: spacewander <[email protected]>
  • Loading branch information
spacewander authored Dec 11, 2024
1 parent 0829273 commit 56e6cb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/common/upstream/cluster_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1781,12 +1781,12 @@ ClusterManagerImpl::requestOnDemandClusterDiscovery(OdCdsApiSharedPtr odcds, std
}

void ClusterManagerImpl::notifyMissingCluster(absl::string_view name) {
ENVOY_LOG(debug, "cm odcds: cluster {} not found during on-demand discovery", name);
ENVOY_LOG(info, "cm odcds: cluster {} not found during on-demand discovery", name);
notifyClusterDiscoveryStatus(name, ClusterDiscoveryStatus::Missing);
}

void ClusterManagerImpl::notifyExpiredDiscovery(absl::string_view name) {
ENVOY_LOG(debug, "cm odcds: on-demand discovery for cluster {} timed out", name);
ENVOY_LOG(info, "cm odcds: on-demand discovery for cluster {} timed out", name);
notifyClusterDiscoveryStatus(name, ClusterDiscoveryStatus::Timeout);
}

Expand Down

0 comments on commit 56e6cb6

Please sign in to comment.