1
votes

I have very important and long jobs working in slave nodes and master node have no jobs. In this situation, I need to reconfigure and update plugins.

(Actually there are many longs jobs(take longer than one hour, but these jobs must restarted in 5 minutes.)

Can I restart Jenkins master node without stopping slave nodes' jobs?

3

3 Answers

0
votes

looks like this question is similar to How reboot Jenkins with running build queue? and as mentioned Safe restart plugin could be considered

0
votes

Jenkins architecture does not allow that and adding support for this in Jenkins would be close to impossible.

If that's so important to you you should look to other CI solutions that allow this.

The only one that I know it can do this is GitLab CI. If I remember well once the job is assigned to a node/slave it will run on it and you can restart the master without affecting the slave or the job.

It would worth mentioning the GitLab CI is similar to Travis CI, probably supporting only 10% of what Jenkins can do but this does not mean that you necessarily need more than this.

0
votes

I just did exactly the scenario the OP asks about, and the result was that all subsequent jobs hang on a sh step for 5 minutes and then get this error:

17:36:31  process apparently never started in /var/lib/jenkins/workspace/TesiraFirmwareNG_develop-tmp/durable-6a718028
17:36:31  (running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)

Anyone know what this is? The purpose of the Durable Task plugin appears to be to enable Jenkins to monitor long running tasks outside Jenkins. Reading this, I believed it to be a key part of how Jenkins manages slaves and their jobs. And that perhaps rebooting the Jenkins slave that had been running the downstream job when I rebooted the Jenkins master, would resolve the durable task problem.

But no luck - after rebooting master and slave I'm still getting the same "process apparently never started" error above. Anyone know the cause of this issue, or know a solution?

UPDATE: Our problem turned out to be an empty environment variable in Jenkins global properties, and nothing to do with slave jobs running when its master restarts. This issue was our cause, and it was only evident after enabling LAUNCH_DIAGNOSTICS java arg, which resulted in more output that showed previously silent errors (empty environment variable passed to docker call) which lead us to root cause.