Skip to content

Commit

Permalink
policy: Reduce SDS initial fetch timeout to 50 milliseconds
Browse files Browse the repository at this point in the history
Avoid stalling network policy updates for extended periods due to missing
SDS secrets by reducing the initial fetch timeout to 50 milliseconds.

Signed-off-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
jrajahalme committed Jan 13, 2025
1 parent 7eac600 commit 670d2fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cilium/grpc_subscription.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ const Protobuf::MethodDescriptor& sotwGrpcMethod(absl::string_view type_url) {
// Note: No rate-limit settings are used, consider if needed.
envoy::config::core::v3::ConfigSource getCiliumXDSAPIConfig() {
auto config_source = envoy::config::core::v3::ConfigSource();
/* config_source.initial_fetch_timeout is set to 5 seconds.
/* config_source.initial_fetch_timeout is set to 50 millliseconds.
* This applies only to SDS Secrets for now, as for NPDS and NPHDS we explicitly set the timeout
* as 0 (no timeout).
*/
config_source.mutable_initial_fetch_timeout()->set_seconds(5);
config_source.mutable_initial_fetch_timeout()->set_nanos(50000000);
config_source.set_resource_api_version(envoy::config::core::v3::ApiVersion::V3);
auto api_config_source = config_source.mutable_api_config_source();
api_config_source->set_set_node_on_first_message_only(true);
Expand Down
2 changes: 1 addition & 1 deletion cilium/secret_watcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace {

// SDS config used in production
envoy::config::core::v3::ConfigSource getCiliumSDSConfig(const std::string&) {
/* returned config_source has initial_fetch_timeout left at default 15 seconds. */
/* returned config_source has initial_fetch_timeout of 50 milliseconds. */
return Cilium::cilium_xds_api_config;
}

Expand Down

0 comments on commit 670d2fb

Please sign in to comment.