Skip to content

Implement pausing for submissions#132

Draft
SemMulder wants to merge 2 commits into
masterfrom
sm/allow-pausing-submissions
Draft

Implement pausing for submissions#132
SemMulder wants to merge 2 commits into
masterfrom
sm/allow-pausing-submissions

Conversation

@SemMulder

Copy link
Copy Markdown
Contributor

Introduce submissions_paused and chunks_paused tables (alongside the existing submissions_{completed,failed,cancelled} and chunks_{completed,failed} tables).

Pausing a submission atomically moves it from submissionssubmissions_paused and its remaining chunks from chunkschunks_paused. Because paused chunks are no longer in the chunks table, the consumer dispatcher naturally skips them without any changes to the dispatch query.

Unpausing reverses the move and notifies waiting consumers.

Paused submissions can also be inserted directly in the paused state (via the new paused: bool field on InsertSubmission); in that case notify_on_insert is intentionally not fired.

Paused submissions are cancellable; cancel_submission now handles the case where the submission is found in submissions_paused.

Introduce `submissions_paused` and `chunks_paused` tables
(alongside the existing `submissions_{completed,failed,cancelled}` and
`chunks_{completed,failed}` tables).

Pausing a submission atomically moves it from `submissions` →
`submissions_paused` and its remaining chunks from `chunks` →
`chunks_paused`. Because paused chunks are no longer in the `chunks`
table, the consumer dispatcher naturally skips them without any changes
to the dispatch query.

Unpausing reverses the move and notifies waiting consumers.

Paused submissions can also be inserted directly in the paused state
(via the new `paused: bool` field on `InsertSubmission`); in that
case `notify_on_insert` is intentionally not fired.

Paused submissions are cancellable; `cancel_submission` now handles
the case where the submission is found in `submissions_paused`.
@SemMulder SemMulder force-pushed the sm/allow-pausing-submissions branch from a9f5556 to bcd4161 Compare July 15, 2026 15:32
@SemMulder

Copy link
Copy Markdown
Contributor Author

TODO: How to deal with reserved chunks when pausing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant