From 2e538b15e918a499862466112b2988f8aa25bd27 Mon Sep 17 00:00:00 2001 From: Joseph Koshakow Date: Thu, 23 Jan 2025 15:21:21 -0500 Subject: [PATCH] adapter: Fix startup parameter default values There are some server configuration parameters that we need during startup, before the catalog has been fully opened. To get the current value we manually look at the current value in LaunchDarkly (which is confusingly returned as `None` if it matches the default value in the code), then we manually look in the catalog, then we manually look in the server parameter default override CLI arg map. Previously, For some of the parameters, if we weren't able to find the value in any of those places, then we hard-code in the value false. This is not correct, and instead we should fall back to their default value, which is sometimes true. This commit fixes the issue by falling back to their default values. --- src/environmentd/src/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/environmentd/src/lib.rs b/src/environmentd/src/lib.rs index af0f775306faf..e0de435080f48 100644 --- a/src/environmentd/src/lib.rs +++ b/src/environmentd/src/lib.rs @@ -401,7 +401,10 @@ impl Listeners { strconv::parse_bool(x).map_err(|x| x.to_string()) })?; let catalog = openable_adapter_storage.get_enable_0dt_deployment().await?; - let computed = ld.or(catalog).or(default).unwrap_or(false); + let computed = ld + .or(catalog) + .or(default) + .unwrap_or(ENABLE_0DT_DEPLOYMENT.default().clone()); info!( %computed, ?ld, @@ -481,7 +484,10 @@ impl Listeners { let catalog = openable_adapter_storage .get_enable_0dt_deployment_panic_after_timeout() .await?; - let computed = ld.or(catalog).or(default).unwrap_or(false); + let computed = ld + .or(catalog) + .or(default) + .unwrap_or(ENABLE_0DT_DEPLOYMENT_PANIC_AFTER_TIMEOUT.default().clone()); info!( %computed, ?ld,