Repository navigation
Release v1.20.0
A job's owner can now stop a job and know when it has really stopped: StopAndDrain answers only once no step work can run for the job any more.
Added
IJobs.StopAndDrain(key, jobId, timeout)stops a job and waits until its steps are drained. It answersDrainedonce no step code runs for the job, each step's outcome and final checkpoint are persisted, andOnStepCompletedOrStoppedandOnStoppedhave finished; otherwiseTimedOut(call again to continue),Completed,NotFoundorUnknownJobType. PassTimeSpan.Zeroto poll without blocking. This adds a member toIJobs, so a hand-writtenIJobsimplementation must add it. See Jobs. (part of #81)IJobDrainlets a job grain be drained directly, andIJobStepDrainis the protocol the job uses to drain its steps. (part of #81)
Changed
- A job whose silo dies during a drain finishes the drain when it next activates and is never resumed;
Resumeis refused while a drain is pending. (part of #81) - A step's stop report from before a
Resumeno longer counts against the resumed job, and a step stopped just before the resume is started again in the resumed execution. Silos older than 1.20 keep the earlier behavior. (part of #81) OnStepCompletedOrStoppedcan run again for a step after a crash, or not at all, so it must be idempotent and owners should not take results from it alone. UseStopAndDrainonly once every silo runs 1.20 or later. (part of #81)