Retry Jitter

This commit is contained in:
Alexey
2026-10-31 14:23:01 +03:00
parent ed2139502f
commit 3df59cfa28
17 changed files with 342 additions and 5 deletions
+3
View File
@@ -260,7 +260,10 @@ const LISTENER_CONFIG_KEYS: &[&str] = &[
"web_trusted_proxy_cidrs",
];
const WEB_RETRY_JITTER_KEYS: &[&str] = &["enabled", "min_ms", "max_ms", "distribution", "peak_ms"];
const WEB_CONFIG_KEYS: &[&str] = &[
"retry_jitter",
"allow_wildcard_hosts",
"enabled",
"carrier",
+8
View File
@@ -36,6 +36,7 @@ fn known_config_keys_for_suggestion() -> Vec<&'static str> {
CONNTRACK_CONTROL_CONFIG_KEYS,
LISTENER_CONFIG_KEYS,
WEB_CONFIG_KEYS,
WEB_RETRY_JITTER_KEYS,
WEB_LIMITS_CONFIG_KEYS,
WEB_WILDCARD_LIMITS_CONFIG_KEYS,
WEB_DEBUG_CONFIG_KEYS,
@@ -236,6 +237,13 @@ pub(super) fn collect_unknown_config_keys(parsed_toml: &toml::Value) -> Vec<Unkn
&["web"],
WEB_CONFIG_KEYS,
);
check_known_table(
parsed_toml,
&mut unknown,
&known_for_suggestion,
&["web", "retry_jitter"],
WEB_RETRY_JITTER_KEYS,
);
check_known_table(
parsed_toml,
&mut unknown,
+5
View File
@@ -75,6 +75,11 @@ pub(super) fn validate_source(config: &mut ProxyConfig) -> Result<()> {
));
}
config
.web
.retry_jitter
.validate()
.map_err(|message| ProxyError::Config(message.into()))?;
validate_limits(&config.web.limits, config.web.allow_wildcard_hosts)?;
debug::validate(&config.web.debug, &config.web.limits)?;
let carriers = negotiation::validate(&config.web)?;