From 265ee59039b965ed8f592dc9dc9043a2e31d8f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Thu, 16 Jul 2026 13:52:36 +0200 Subject: [PATCH] httpd: Raise open-file limit at startup Resolving a repo's signed refs opens a descriptor per packfile, and radicle storage can hold thousands, so the default limit is exhausted and reads fail with spurious "missing object" errors. --- crates/radicle-httpd/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/radicle-httpd/src/lib.rs b/crates/radicle-httpd/src/lib.rs index aa2b0c073..0f7d67544 100644 --- a/crates/radicle-httpd/src/lib.rs +++ b/crates/radicle-httpd/src/lib.rs @@ -74,6 +74,14 @@ pub async fn run(options: Options) -> anyhow::Result<()> { tracing::info!("{}", str::from_utf8(&git_version)?.trim()); + // Listing a repo's refs resolves every remote's signed refs through libgit2, + // opening a descriptor per packfile. Radicle storage can hold thousands of + // packfiles, so under a low default limit reads exhaust file descriptors and + // objects in unopened packs fail with spurious "missing" errors. + if let Err(e) = radicle::io::set_file_limit(4096) { + tracing::warn!("Unable to set open file limit: {e}"); + } + let listener = DualListener::bind(&options.listen).await?; tracing::info!("listening on {:?}", &options.listen);