Skip to content

Commit

Permalink
Lower log message level for nailgun to reduce verbosity (#20946)
Browse files Browse the repository at this point in the history
Nailgun starting log message makes Pants output very verbose and could
actually feel somewhat annoying.
  • Loading branch information
alonsodomin authored May 27, 2024
1 parent a4032b8 commit b761705
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/notes/2.22.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/core/goals/check_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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..],
Expand Down

0 comments on commit b761705

Please sign in to comment.