Skip to content

Notify running jobs on SQLite cancellation - #1398

Merged
bgentry merged 1 commit into
masterfrom
bg/sqlite-job-cancel-notification
Sep 27, 2026
Merged

bgentry merged 1 commit into
masterfrom
bg/sqlite-job-cancel-notification

Conversation

@bgentry

@bgentry bgentry commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

SQLite's JobCancel updates running jobs without writing a control notification. Because SQLite supports listeners, workers can remain unaware of the cancellation.

Write the notification to the outbox in the same transaction as the job update. Shared driver tests verify worker context cancellation across the supported SQLite variants, delivery after JobCancelTx commits, and no delivery after rollback.

@bgentry
bgentry force-pushed the bg/sqlite-job-cancel-notification branch 2 times, most recently from 2083565 to c4d68ee Compare September 27, 2026 22:03
@bgentry
bgentry force-pushed the bg/sqlite-job-cancel-notification branch from c4d68ee to 0968ba0 Compare September 27, 2026 22:09
@bgentry
bgentry enabled auto-merge (squash) September 27, 2026 22:09
SQLite clients rely on the notification outbox to cancel running job
contexts. `JobCancel` marks a job for cancellation without writing a
control notification, so workers keep running indefinitely.

Insert a cancel notification through sqlc in the same transaction as
the job update. The outbox row becomes visible only when `JobCancelTx`
commits, and an empty control topic leaves direct driver calls valid.

Exercise worker context cancellation across SQLite variants, along
with notification delivery on commit and absence on rollback.
@bgentry
bgentry force-pushed the bg/sqlite-job-cancel-notification branch from 0968ba0 to 0b52826 Compare September 27, 2026 22:12
@bgentry
bgentry merged commit ccca11d into master Sep 27, 2026
15 checks passed
@bgentry
bgentry deleted the bg/sqlite-job-cancel-notification branch September 27, 2026 22:16
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.

2 participants