Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tonic-xds/src/client/retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub(crate) fn is_retryable_grpc_status_code(
code: tonic::Code,
retryable_codes: &[tonic::Code],
) -> bool {
retryable_codes.contains(&code)
code != tonic::Code::Ok && retryable_codes.contains(&code)
}

/// Check if a request should be retried, either because of a retryable connection error
Expand Down Expand Up @@ -439,6 +439,12 @@ mod tests {
assert!(!is_retryable_grpc_status_code(tonic::Code::Ok, &codes));
}

#[test]
fn test_ok_should_not_be_retried() {
let codes = vec![tonic::Code::Ok];
assert!(!is_retryable_grpc_status_code(tonic::Code::Ok, &codes))
}

#[test]
fn test_empty_retryable_codes() {
assert!(!is_retryable_grpc_status_code(
Expand Down
1 change: 1 addition & 0 deletions tonic-xds/src/xds/resource/route_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ fn validate_header_matcher(
use envoy_types::pb::envoy::config::route::v3::header_matcher::HeaderMatchSpecifier;
use envoy_types::pb::envoy::r#type::matcher::v3::string_matcher::MatchPattern;

#[allow(deprecated)]
let match_specifier = match hm.header_match_specifier {
Some(HeaderMatchSpecifier::ExactMatch(v)) => HeaderMatchSpecifierConfig::Exact {
value: v,
Expand Down
Loading