mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-01 22:50:54 +00:00
runtime-rs: enforce a minimum vsock reconnect window
Low-CPU sandboxes can take longer than a few seconds to complete guest boot and start the agent. Let's clamp the reconnect timeout to a safe minimum so sandbox startup does not fail early with transient vsock ECONNRESET. Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com> Assisted-by: Codex <codex@openai.com>
This commit is contained in:
@@ -90,9 +90,14 @@ pub struct ConnectConfig {
|
||||
|
||||
impl ConnectConfig {
|
||||
pub fn new(dial_timeout_ms: u64, reconnect_timeout_ms: u64) -> Self {
|
||||
// With static sandbox resource sizing enabled by default, tiny CPU
|
||||
// allocations can make early guest boot/agent startup exceed 3s on
|
||||
// loaded nodes. Keep a reasonable lower bound to avoid premature
|
||||
// sandbox teardown during agent bring-up.
|
||||
const MIN_RECONNECT_TIMEOUT_MS: u64 = 10_000;
|
||||
Self {
|
||||
dial_timeout_ms,
|
||||
reconnect_timeout_ms,
|
||||
reconnect_timeout_ms: reconnect_timeout_ms.max(MIN_RECONNECT_TIMEOUT_MS),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user