From 5ecd1146b6f113dc76731a224ba108f4e14fcfe5 Mon Sep 17 00:00:00 2001 From: "Sebastian Kohn (Nova)" Date: Wed, 17 Dec 2025 17:04:04 +0100 Subject: [PATCH 1/2] local_backend: use HTTP_SERVER_TIMEOUT_DURATION knob instead of hardcoded timeout --- crates/common/src/knobs.rs | 2 +- crates/local_backend/src/main.rs | 3 ++- crates/local_backend/src/proxy.rs | 18 +++++++++--------- self-hosted/docker/docker-compose.yml | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/crates/common/src/knobs.rs b/crates/common/src/knobs.rs index b08cd1578..a4ae1fa91 100644 --- a/crates/common/src/knobs.rs +++ b/crates/common/src/knobs.rs @@ -1291,7 +1291,7 @@ pub static TABLE_SUMMARY_AGE_JITTER_SECONDS: LazyLock = /// /// See https://docs.rs/tower-http/0.5.0/tower_http/timeout/struct.TimeoutLayer.html pub static HTTP_SERVER_TIMEOUT_DURATION: LazyLock = - LazyLock::new(|| Duration::from_secs(env_config("HTTP_SERVER_TIMEOUT_SECONDS", 300))); + LazyLock::new(|| Duration::from_secs(env_config("HTTP_SERVER_TIMEOUT_SECONDS", 125))); /// The limit on the request size to /push_config. // Schema and code bundle pushes must be less than this. diff --git a/crates/local_backend/src/main.rs b/crates/local_backend/src/main.rs index 5491b62fc..8411a150c 100644 --- a/crates/local_backend/src/main.rs +++ b/crates/local_backend/src/main.rs @@ -5,6 +5,7 @@ use cmd_util::env::config_service; use common::{ errors::MainError, http::ConvexHttpService, + knobs::HTTP_SERVER_TIMEOUT_DURATION, runtime::Runtime, sentry::set_sentry_tags, shutdown::ShutdownSignal, @@ -134,7 +135,7 @@ async fn run_server_inner(runtime: ProdRuntime, config: LocalConfig) -> anyhow:: "backend", SERVER_VERSION_STR.to_string(), MAX_CONCURRENT_REQUESTS, - Duration::from_secs(125), + *HTTP_SERVER_TIMEOUT_DURATION, HttpActionRouteMapper, ); let serve_http_future = http_service.serve(config.http_bind_address().into(), async move { diff --git a/crates/local_backend/src/proxy.rs b/crates/local_backend/src/proxy.rs index 5ab6382b4..23889a066 100644 --- a/crates/local_backend/src/proxy.rs +++ b/crates/local_backend/src/proxy.rs @@ -1,7 +1,4 @@ -use std::{ - net::SocketAddr, - time::Duration, -}; +use std::net::SocketAddr; use axum::{ extract::{ @@ -12,10 +9,13 @@ use axum::{ routing::get, Router, }; -use common::http::{ - ConvexHttpService, - HttpResponseError, - NoopRouteMapper, +use common::{ + http::{ + ConvexHttpService, + HttpResponseError, + NoopRouteMapper, + }, + knobs::HTTP_SERVER_TIMEOUT_DURATION, }; use hyper_util::rt::TokioExecutor; @@ -60,7 +60,7 @@ pub async fn dev_site_proxy( "backend_http_proxy", "unknown".to_string(), 4, - Duration::from_secs(125), + *HTTP_SERVER_TIMEOUT_DURATION, NoopRouteMapper, ); let proxy_server = service.serve(addr.into(), async move { diff --git a/self-hosted/docker/docker-compose.yml b/self-hosted/docker/docker-compose.yml index cda24a406..1298157c0 100644 --- a/self-hosted/docker/docker-compose.yml +++ b/self-hosted/docker/docker-compose.yml @@ -25,6 +25,7 @@ services: - DISABLE_BEACON - DOCUMENT_RETENTION_DELAY=${DOCUMENT_RETENTION_DELAY:-172800} # Lower default document retention to 2 days - DO_NOT_REQUIRE_SSL + - HTTP_SERVER_TIMEOUT_SECONDS - INSTANCE_NAME - INSTANCE_SECRET - MYSQL_URL From e366e90673a2731c0ea5ef34b5d8148a3aa9ccf4 Mon Sep 17 00:00:00 2001 From: "Sebastian Kohn (Nova)" Date: Sat, 20 Dec 2025 11:00:17 +0100 Subject: [PATCH 2/2] chore: revert default for `HTTP_SERVER_TIMEOUT_DURATION` to 300s --- crates/common/src/knobs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/common/src/knobs.rs b/crates/common/src/knobs.rs index a4ae1fa91..b08cd1578 100644 --- a/crates/common/src/knobs.rs +++ b/crates/common/src/knobs.rs @@ -1291,7 +1291,7 @@ pub static TABLE_SUMMARY_AGE_JITTER_SECONDS: LazyLock = /// /// See https://docs.rs/tower-http/0.5.0/tower_http/timeout/struct.TimeoutLayer.html pub static HTTP_SERVER_TIMEOUT_DURATION: LazyLock = - LazyLock::new(|| Duration::from_secs(env_config("HTTP_SERVER_TIMEOUT_SECONDS", 125))); + LazyLock::new(|| Duration::from_secs(env_config("HTTP_SERVER_TIMEOUT_SECONDS", 300))); /// The limit on the request size to /push_config. // Schema and code bundle pushes must be less than this.