Skip to content

Release v1.21.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 07:50
d817754

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

  • IJobAdmission lets a job's owner allow or refuse a job's execution. Register it with siloBuilder.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.NotAdmitted is returned when the owner refuses a job's start, and CannotResumeJobError.NotAdmitted when it refuses a resume. IJobsManager.Resume returns false for a refused job. (#81)

Changed

  • Admission is asked before Start, before every Resume (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 MayRun fails 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)
  • MayRun runs 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, call StopAndDrain first, then refuse them from MayRun. Silos older than 1.21 do not ask, so the guarantee holds once every silo runs 1.21 or later. (#81)