com-lihaoyi / mill

Mill is a fast JVM build tool that supports Java and Scala. 2-3x faster than Gradle and 5-10x faster than Maven for common workflows, Mill aims to make your project’s build process performant, maintainable, and flexible
https://mill-build.org/
MIT License
2.04k stars 331 forks source link

Add coarse grained lock around BSP requests to avoid deadlocks #3243

Closed lihaoyi closed 3 months ago

lihaoyi commented 3 months ago

Fixes https://github.com/com-lihaoyi/mill/issues/3100, which for some reason is happening frequently enough on my laptop to really hamper my productivity. With a version of Mill built from this PR, the problem seems to have gone away.

We don't really have a strong concurrency model for what's meant to happen when multiple Mill commands are being evaluated at once, and trying to come up with one is a complex task that I don't think is worth the effort. Bazel works fine with a coarse-grained lock even for huge codebases and organizations, so this should do for Mill for now.

Pull request: https://github.com/com-lihaoyi/mill/pull/3243