Repository navigation
Release v1.21.0
A job's owner can now refuse a job's execution: the job engine asks the owner before a job starts, before it resumes for any reason, and before each later stage starts.
Added
IJobAdmissionlets a job's owner allow or refuse a job's execution. Register it withsiloBuilder.AddJobAdmission<T>()on every silo that can host the owner's job types.MayRun(JobAdmissionRequest, CancellationToken)receives the job's key, id, type and request; every registered admission must allow, and with none registered every job runs. See Admit or refuse a job's execution. (#81)StartJobError.NotAdmittedis returned when the owner refuses a job's start, andCannotResumeJobError.NotAdmittedwhen it refuses a resume.IJobsManager.Resumereturnsfalsefor a refused job. (#81)
Changed
- Admission is asked before
Start, before everyResume(explicit,IJobsManager.Resume, rehydration after a silo dies, and recovery), and before every stage after the first. A refused job that is running is stopped and drained, and it is not resumed while the owner keeps refusing. A refused stage stops the job. (#81) - An exception or timeout in
MayRunfails the start or resume and changes nothing. It is never a refusal. A stage whose admission cannot be answered is asked again on a timer. (#81) MayRunruns inside the job's turn, so it must not call the job, its steps, or a non-interleaving method of a grain that may be waiting on the job's start or resume. To change what running jobs may do, callStopAndDrainfirst, then refuse them fromMayRun. Silos older than 1.21 do not ask, so the guarantee holds once every silo runs 1.21 or later. (#81)