From 6815afb6fe827be3725286183fad409f560daa10 Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Fri, 23 Feb 2024 14:33:09 +0200 Subject: [PATCH] Increase internal proxy timeout from 5 seconds to 10 seconds to fix long agent ops (#2265) --- changelog.d/+internal-proxy-timeout.changed.md | 1 + mirrord/layer/src/lib.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelog.d/+internal-proxy-timeout.changed.md diff --git a/changelog.d/+internal-proxy-timeout.changed.md b/changelog.d/+internal-proxy-timeout.changed.md new file mode 100644 index 00000000000..185fcd99e15 --- /dev/null +++ b/changelog.d/+internal-proxy-timeout.changed.md @@ -0,0 +1 @@ +Increase internal proxy timeout from 5 seconds to 10 seconds to fix long agent ops \ No newline at end of file diff --git a/mirrord/layer/src/lib.rs b/mirrord/layer/src/lib.rs index 0866ffca16a..2c11e62c9b6 100644 --- a/mirrord/layer/src/lib.rs +++ b/mirrord/layer/src/lib.rs @@ -160,6 +160,10 @@ static EXECUTABLE_PATH: OnceLock = OnceLock::new(); /// Program arguments static EXECUTABLE_ARGS: OnceLock> = OnceLock::new(); +/// Proxy Connection timeout +/// Set to 10 seconds as most agent operations timeout after 5 seconds +const PROXY_CONNECTION_TIMEOUT: Duration = Duration::from_secs(10); + /// Loads mirrord configuration and does some patching (SIP, dotnet, etc) fn layer_pre_initialization() -> Result<(), LayerError> { let given_process = EXECUTABLE_NAME.get_or_try_init(ExecutableName::from_env)?; @@ -226,7 +230,7 @@ fn load_only_layer_start(config: &LayerConfig) { .expect("failed to parse internal proxy address"); let new_connection = - ProxyConnection::new(address, NewSessionRequest::New, Duration::from_secs(5)) + ProxyConnection::new(address, NewSessionRequest::New, PROXY_CONNECTION_TIMEOUT) .expect("failed to initialize proxy connection"); unsafe { @@ -354,7 +358,7 @@ fn layer_start(mut config: LayerConfig) { unsafe { let address = setup().proxy_address(); let new_connection = - ProxyConnection::new(address, NewSessionRequest::New, Duration::from_secs(5)) + ProxyConnection::new(address, NewSessionRequest::New, PROXY_CONNECTION_TIMEOUT) .expect("failed to initialize proxy connection"); PROXY_CONNECTION .set(new_connection)