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.
This commit is contained in:
Rūdolfs Ošiņš
2026-07-29 09:36:31 +02:00
parent 8b30bc75d3
commit 265ee59039
+8
View File
@@ -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);