-
-
Notifications
You must be signed in to change notification settings - Fork 403
Use a single Mill server process #5066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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.
Fixes #5031
We now only have a single server process running at a time, and no longer keep up to 5 separate
serverDir-1
toserverDir-5
folders. Essentially we are migrating from the style of concurrency used bygradle
andmvnd
to the style of concurrency used bybazel
We now only hold the
clientLock
until the server process is initialized (and has taken it'sprocessLock
) to avoid redundant initialization, and after that we release it to allow multiple clients to connectSince there is only one server and one
serverDir
, we have to remove several per-server files since there is no way to ensure they are unique in the presence of multiple clientsrunArgs
can no longer be a file, and instead we send its contents over the socket before starting theInputPumper
We can no longer rely on
clientLock
probing to check if the client has disconnected, and so we instead have the server sendProxyStream.HEARTBEAT
bytes (127) and look for errorsServer#run
can no longer accept socket connections and process them in a single-threaded loop, and instead needs to spawn off threads to handle each connected socket--watch
mode and idle we want to allow another client to proceed with execution. So locking needs to be done at a finer-grained granularity within the serverThe original
millLock
file (renamedmillOutLock
) has been combined with aMemoryLock
viaDoubleLock
, which lets us check the memory-lock first to avoid taking the file-lock twice on the same JVM and causing aOverlappingFileLockException
. We still need to keep the file-lock to provide mutex between server and no-server processes, or between multiple no-server processesNow that things are in one process, that opens up the possibility of loosening the concurrency constraints in future, e.g. allowing multiple concurrent evaluations that do not interfere with each other.