sbt/lm-coursier
eugene yokota a893b1c86d
[2.0.x] fix: Parallelize dependency resolution when no progress bar is rendered (#9274)
`update` held a process-global lock around coursier resolution and artifact
fetching whenever a logger was set OR coursier was not in fallback mode. That
lock exists only to serialize coursier's interactive progress bar, which is
rendered solely when no custom logger is supplied and coursier is not in
fallback mode. The `loggerOpt.nonEmpty` clause therefore over-serialized the
common non-interactive case (IntelliJ re-imports, CI, any non-TTY run, where
sbt supplies a quiet debug-only logger), making `update` scale with the number
of modules rather than the number of distinct artifacts.

Narrow the predicate to `!hasCustomLogger && !fallbackMode`
(Lock.progressBarActive), so resolution runs in parallel unless coursier is
actually drawing its progress bar. Interactive terminals stay serialized;
COURSIER_PROGRESS=false opts into parallelism there, and #5627 tracks fully
parallel resolution with live progress bars.

Safe: SbtCoursierCache is ConcurrentHashMap-backed, a CacheLogger is already
invoked concurrently within a single resolution (parallel downloads), and the
COURSIER_PROGRESS=false parallel path has been used in production for years.

Fixes #5508.

Co-authored-by: Brian Hotopp <brihoto@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 21:12:10 -04:00
..
definitions/src/main/scala/lmcoursier [2.x] feat: Add dependency lock file support (#2989) (#8581) 2026-01-21 19:08:59 -05:00
metadata@95874ca5bd Move metadata to lm-coursier/metadata 2024-10-09 09:44:42 +02:00
src [2.0.x] fix: Parallelize dependency resolution when no progress bar is rendered (#9274) 2026-05-30 21:12:10 -04:00
NOTICE Add NOTICE and headerLicense 2024-10-11 14:32:32 +02:00