-
Notifications
You must be signed in to change notification settings - Fork 32
Add retry on eager #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add retry on eager #393
Conversation
Signed-off-by: Evaline Ju <[email protected]>
Signed-off-by: gkumbhat <[email protected]>
Signed-off-by: Evaline Ju <[email protected]>
Signed-off-by: gkumbhat <[email protected]>
Signed-off-by: gkumbhat <[email protected]>
Signed-off-by: gkumbhat <[email protected]>
Signed-off-by: gkumbhat <[email protected]>
@@ -73,7 +73,7 @@ tokio-rustls = { version = "0.26.1", features = ["ring"] } | |||
tokio-stream = { version = "0.1.17", features = ["sync"] } | |||
tonic = { version = "0.12.3", features = [ | |||
"tls", | |||
"tls-roots", | |||
"tls-native-roots", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tls-roots
is being deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebase and left a couple of nit comments, but I think this is fine until we find a better client-level solution
src/clients.rs
Outdated
@@ -70,6 +70,9 @@ pub mod openai; | |||
const DEFAULT_CONNECT_TIMEOUT_SEC: u64 = 60; | |||
const DEFAULT_REQUEST_TIMEOUT_SEC: u64 = 600; | |||
const DEFAULT_GRPC_PROBE_INTERVAL_SEC: u64 = 10; | |||
const DEFAULT_RES_STRATEGY_INTERVAL_SEC: u64 = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a timeout and not an interval, rename to DEFAULT_RES_STRATEGY_TIMEOUT_SEC
and update "interval" to "timeout" accordingly in the config field names
src/clients.rs
Outdated
let resolution_strategy = | ||
if let Some(resolution_strategy_override) = &service_config.resolution_strategy { | ||
match resolution_strategy_override.as_str() { | ||
"eager" => ResolutionStrategy::Eager { | ||
timeout: (Duration::from_secs( | ||
service_config | ||
.resolution_strategy_interval | ||
.unwrap_or(DEFAULT_RES_STRATEGY_INTERVAL_SEC), | ||
)), | ||
}, | ||
_ => ResolutionStrategy::Lazy, | ||
} | ||
} else { | ||
ResolutionStrategy::Lazy | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: recommend decoupling the timeout and simplifying the match, e.g.
let resolution_strategy_timeout = Duration::from_secs(
service_config
.resolution_strategy_timeout
.unwrap_or(DEFAULT_RES_STRATEGY_TIMEOUT_SEC),
);
let resolution_strategy = match &service_config.resolution_strategy {
Some(name) if name == "eager" => ResolutionStrategy::Eager {
timeout: resolution_strategy_timeout,
},
_ => ResolutionStrategy::Lazy,
};
Signed-off-by: gkumbhat <[email protected]>
Changes