This project has moved. For the latest updates, please go here.
1

Closed

ShutdownTimeout = -4

description

Let's say the service is stopped while a job is running, the jobs's status is set to ShutdownTimeout = -4.

After the service restarts, that job's status seems not to change from "ShutdownTimeout = -4".
So this job does not a have a chance to schedule again.
I think the service must schedule this jobs again after restart.
Closed Jan 9, 2014 at 11:29 PM by dawidpotgieter

comments

susahin80 wrote Nov 12, 2013 at 8:08 AM

I solved this issue by Updating the Status from "ShutdownTimeout = -4" to "Scheduled = 4" in CheckAbnormallyTerminatedJobs() method.
(all my jobs have schedule so I can this)
        var scheduledReadyJobs = jobManager.JobStore.GetJobs(0, int.MaxValue, null, null, new JobStatus[] { JobStatus.Ready, __JobStatus.ShutdownTimeout__}).Where(j => (j.Instance == null || j.Instance == SettingsProvider.InstanceName) && j.Schedule != null);

        jobManager.JobStore.SetJobStatuses(scheduledReadyJobs.Select(j => j.Id).ToArray(), JobStatus.Ready, JobStatus.Scheduled, null, null); //Set instance to null here
 __       jobManager.JobStore.SetJobStatuses(scheduledReadyJobs.Select(j => j.Id).ToArray(), JobStatus.ShutdownTimeout, JobStatus.Scheduled, null, null); //Set instance to null here__

dawidpotgieter wrote Jan 9, 2014 at 11:00 PM

Thanks for the answer,

I will update the code accordingly.

dawidpotgieter wrote Jan 9, 2014 at 11:17 PM

Ah,

I see where this can cause a problem in the UI :

default.aspx.cs, line 91 :
var jobs = accessPoint.GetJobs(new GetJobsRequest
{
    JobIds = alerts.Select(a => a.JobId).ToArray(),
    Take = int.MaxValue,
});
If there are too many alerts (more than 2100 I guess), it will try to load the jobs by id. Just clear out your alerts or move this logic around a bit to "page" the GetJobs call.

dawidpotgieter wrote Jan 9, 2014 at 11:18 PM

Ignore the above, this is for a different issue :p

wrote Jan 9, 2014 at 11:25 PM

wrote Jan 9, 2014 at 11:29 PM

Resolved with changeset 28033.