From b761705a49324475bcab90c38f18536797249905 Mon Sep 17 00:00:00 2001 From: "A. Alonso Dominguez" <2269440+alonsodomin@users.noreply.github.com> Date: Mon, 27 May 2024 11:02:36 +0200 Subject: [PATCH] Lower log message level for nailgun to reduce verbosity (#20946) Nailgun starting log message makes Pants output very verbose and could actually feel somewhat annoying. --- docs/notes/2.22.x.md | 4 ++++ src/python/pants/core/goals/check_test.py | 2 +- .../engine/process_execution/pe_nailgun/src/nailgun_pool.rs | 5 ++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/notes/2.22.x.md b/docs/notes/2.22.x.md index b10833dc07a..1811469957f 100644 --- a/docs/notes/2.22.x.md +++ b/docs/notes/2.22.x.md @@ -56,6 +56,10 @@ deploy jars, in addition to those specified on a per-jar basis in the `deploy_ja This option's default value excludes signature files from constituent jars, which are known to cause the deploy jar to fail to execute (since naturally it doesn't match those signatures). +Also reduced verbosity of log messages for the internal Nailgun server instances used for running or compiling code +replacing it by a single message informing about the size of the Nailgun pool. Previous log messages are still +emitted at debug log level. + The internal code for exporting JVM tools was refactored. ##### Scala diff --git a/src/python/pants/core/goals/check_test.py b/src/python/pants/core/goals/check_test.py index dc310782220..1be684cd3c4 100644 --- a/src/python/pants/core/goals/check_test.py +++ b/src/python/pants/core/goals/check_test.py @@ -157,7 +157,7 @@ def run_typecheck_rule( ) -> Tuple[int, str]: union_membership = UnionMembership({CheckRequest: request_types}) check_subsystem = create_subsystem(CheckSubsystem, only=only or []) - with mock_console(create_options_bootstrapper()) as (console, stdio_reader): + with mock_console(create_options_bootstrapper(["-lwarn"])) as (console, stdio_reader): rule_runner = RuleRunner() result: Check = run_rule_with_mocks( check, diff --git a/src/rust/engine/process_execution/pe_nailgun/src/nailgun_pool.rs b/src/rust/engine/process_execution/pe_nailgun/src/nailgun_pool.rs index e21bef5a7f5..6706b1f53f6 100644 --- a/src/rust/engine/process_execution/pe_nailgun/src/nailgun_pool.rs +++ b/src/rust/engine/process_execution/pe_nailgun/src/nailgun_pool.rs @@ -67,6 +67,7 @@ pub struct NailgunPool { impl NailgunPool { pub fn new(workdir_base: PathBuf, size: usize, store: Store, executor: Executor) -> Self { + info!("Initializing Nailgun pool for {} processes...", size); NailgunPool { workdir_base, size, @@ -285,9 +286,7 @@ fn spawn_and_read_port( workdir: PathBuf, ) -> Result<(std::process::Child, Port), String> { let cmd = process.argv[0].clone(); - // TODO: This is an expensive operation, and thus we info! it. - // If it becomes annoying, we can downgrade the logging to just debug! - info!( + debug!( "Starting new nailgun server with cmd: {:?}, args {:?}, in cwd {}", cmd, &process.argv[1..],