feat(controller): support stopping periodic and errored jobs#2131
Open
shiyasmohd wants to merge 1 commit intomainfrom
Open
feat(controller): support stopping periodic and errored jobs#2131shiyasmohd wants to merge 1 commit intomainfrom
shiyasmohd wants to merge 1 commit intomainfrom
Conversation
Extend the scheduler stop path so periodic jobs parked in terminal states between fires remain stoppable, and one-shot jobs in retryable ERROR can be cancelled before the next retry. - Accept `Scheduled`/`Running`/`Completed`/`Error`/`Fatal` as stop sources in `job_status::request_stop`; keep idempotent `Ok(false)` for `StopRequested`/`Stopping` - Filter non-periodic `Completed`/`Fatal` in `Scheduler::stop_job_impl` using a new `jobs::get_by_id_with_descriptor` single-round-trip lookup plus `Trigger::from_descriptor` periodicity check - Emit `TriggerCommand::Unregister` after a successful stop commit so periodic timers are torn down - Refresh stop handler and `request_stop` docs to reflect the one-shot vs periodic state-transition matrix - Add DB-layer tests for stopping from `Completed`/`Error`/`Fatal` and an integration test that forces a one-shot job to `ERROR` and asserts stop succeeds Signed-off-by: Shiyas Mohammed <shiyasmohd.official@gmail.com>
10f5668 to
1324d7c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend the scheduler stop path so periodic jobs parked in terminal states between fires remain stoppable, and one-shot jobs in retryable ERROR can be cancelled before the next retry.
Scheduled/Running/Completed/Error/Fatalas stop sources injob_status::request_stop; keep idempotentOk(false)forStopRequested/StoppingCompleted/FatalinScheduler::stop_job_implusing a newjobs::get_by_id_with_descriptorsingle-round-trip lookup plusTrigger::from_descriptorperiodicity checkTriggerCommand::Unregisterafter a successful stop commit so periodic timers are torn downrequest_stopdocs to reflect the one-shot vs periodic state-transition matrixCompleted/Error/Fataland an integration test that forces a one-shot job toERRORand asserts stop succeeds