-
Improvement
-
Resolution: Won't Fix
-
Minor
-
None
I use /safeRestart after upgrading Hudson core or plugins, and this works.
Unfortunately I often see the following situation: there are a lot of jobs which typically run in anything from a couple of minutes to an hour or two; and there is one job (which is usually running) which takes six or seven hours.
Now if I ask Hudson to restart when the slow job has just been recently started, several hours will pass during which only this job is running. Hudson could be running other faster jobs in parallel (especially on different nodes which are otherwise idle), but it refuses to start any new builds during shutdown mode.
Since this would result in a loss of several hours of productive CPU time, I am discouraged from asking to initiate a restart until outside of normal business hours, or at least until all running slow jobs seem to nearing their end. But then I need to wait around for a few hours just to click a link, which defeats the purpose of using /safeRestart over simply clicking Prepare for Shutdown and restarting manually when done.
Perhaps Hudson's scheduler could be more permissive during shutdown mode. If jobs are placed in the queue whose expected run time is significantly less than the maximum expected time remaining for currently running jobs, start them. (Especially if they are destined to be run on an otherwise idle node; if they would be run on the same node as one of the running jobs, this strategy is more questionable since it may slow down the running job and thus make the shutdown in fact take longer.)