Repository navigation
Run at most one BSP server per build client - #6905
Merged
lihaoyi merged 1 commit intoMar 5, 2026
Merged
Conversation
And kill previously running BSP server if needed
Member
|
This is only relevant to instances sharing the same |
Collaborator
Author
Yes, the lock files for this live under the output directory that ended up being picked ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes Mill run at most one BSP server per build client type in a given project. This identifies build clients with their "display name" in the build initialize request, and ensures only one build server for this display name runs at a time.
If two build servers run at a time for build clients with the same display name, it is likely the first one is a zombie that's not needed anymore. Yet, it keeps watching the build sources, and tries to re-compile the build every time its sources change. Build servers hinder each other in such a scenario, so this PR makes this more unlikely, by having the second build server kill the first one upon startup.
Knowing if a build server already runs is handled the same way as locking when running tasks, except we also put the display name in the lock file name and its accompanying "active" info file name, and we default to killing the other Mill process here, rather than waiting for it to release the lock.
The build client display name is taken into account here, so that users can still have a Mill BSP server running for IntelliJ and another one running for VSCode.