-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Differentiate by Mill version when selecting a server worker #2639
Conversation
In older Mill versions, we tried to detect when the Mill version changed. In that case, we stopped the server process and started a new one. This server stopping worked unrelieble and is currently not working at all. This pragmatic change simply does not try to re-use a mill server process when the Mill version does not match. Instead, we only choose between instances with the exact version or start a new instance. This is identical to the beavior, when we run with a differnet JVM. Resource wise, we potentially increate the amount of running processes, but we do this anyways in other situations. Also, idle Mill servers stop themselves after a some time span.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine. Should we leave the mill version un-hashes? Might make it easier to inspect and see what's going on if the mill version was in plaintext as part lf the file path
Would be fine by me. That was actually my first approach, but the resulting name was rather long. For more insights, we could also leave some info as file in the directory, e.g. start time, Mill version, Java details, maybe even a history of executed tasks. |
For some reasons, I always get an exception, when I include the plain Mill version in the Mill worker directory: - String versionAndJvmHomeEncoding = Util.sha1Hash(BuildInfo.millVersion + System.getProperty("java.home"));
+ final String versionAndJvmHomeEncoding = BuildInfo.millVersion + "-" + Util.sha1Hash(System.getProperty("java.home"));
+ System.err.println("==> " + versionAndJvmHomeEncoding);
Maybe the dots. I don't know. To keep things simple, I will just keep it in the hashed form, which works as expected. |
In older Mill versions, we tried to detect when the Mill version changed. In that case, we stopped the server process and started a new one. This server stopping worked unrelieble and is currently not working at all.
This pragmatic change simply does not try to re-use a mill server process when the Mill version does not match. Instead, we only choose between instances with the exact version or start a new instance. This is identical to the beavior, when we run with a differnet JVM.
Resource wise, we potentially increase the amount of running processes, but we do this anyways in other situations. Also, idle Mill servers stop themselves after a some time span.