Currently when -labelsFile file changes, the client is blindly restarted, interrupting any running jobs. In my opinion, the only advantage of -labelsFile flag is to eliminate the need to restart the client for label changes and therefore avoid interrupting jobs.
Currently my puppet instrumentation updates the init.d script with any changes to the -labels parameter and then restarts the system service. In order to avoid job interruptions I had to write my own logic that detects the number of running jobs, sets the slave temporarily offline, restarts it once jobs finish, etc. I doubt that my needs are unusual. In this context, the new -labelsFile parameter is not a useful addition unless it can handle all of that.
In other words, it should either:
- Not restart the client but update labels on the fly.
- Restart the client gracefully (when no jobs are running).
(Note that this is different from
JENKINS-45295 where the client stays down for some reason)