diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fac3ea4d..7f5a95e02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - The `vectorscan` and `vectorscan-sys` crates have been split off into a [separate project](https://github.com/bradlarsen/vectorscan-rs) with crates published on crates.io ([#168](https://github.com/praetorian-inc/noseyparker/pull/168)). +### Fixes + +- Upon `noseyparker` startup, if resource limits cannot be adjusted, instead of crashing, a warning is printed and the process attempts to continue ([#170](https://github.com/praetorian-inc/noseyparker/issues/170)). + ## [v0.17.0](https://github.com/praetorian-inc/noseyparker/releases/v0.17.0) (2024-03-05) diff --git a/crates/noseyparker-cli/src/main.rs b/crates/noseyparker-cli/src/main.rs index fdca5e40c..726419bf2 100644 --- a/crates/noseyparker-cli/src/main.rs +++ b/crates/noseyparker-cli/src/main.rs @@ -3,7 +3,7 @@ use mimalloc::MiMalloc; static GLOBAL: MiMalloc = MiMalloc; use anyhow::{Context, Result}; -use tracing::debug; +use tracing::{debug, warn}; mod args; mod cmd_datastore; @@ -94,7 +94,10 @@ fn try_main(args: &CommandLineArgs) -> Result<()> { configure_backtraces(global_args); configure_color(global_args); configure_tracing(global_args).context("Failed to initialize logging")?; - configure_rlimits(global_args).context("Failed to initialize resource limits")?; + + if let Err(e) = configure_rlimits(global_args) { + warn!("Failed to initialize resource limits: {e}"); + } match &args.command { args::Command::Datastore(args) => cmd_datastore::run(global_args, args), diff --git a/crates/noseyparker-cli/tests/test_noseyparker.rs b/crates/noseyparker-cli/tests/test_noseyparker.rs index 5f74a3c1d..7cf8d1032 100644 --- a/crates/noseyparker-cli/tests/test_noseyparker.rs +++ b/crates/noseyparker-cli/tests/test_noseyparker.rs @@ -26,3 +26,4 @@ mod scan; // TODO(test): add tests for enumerating GitHub Enterprise with the `--ignore-certs` optino // TODO(test): add tests for `scan --git-url=URL --ignore-certs` // TODO(test): add test case that validates `report -f json` output against the JSON schema (see the `jsonschema` crate) +// TODO(test) add test that failing to set rlimits at startup doesn't crash, but outputs a warning