Skip to content

Add job cleaner excluded queues that can be configured through pilot#1004

Merged
brandur merged 1 commit into
masterfrom
brandur-ommitted-queues
Aug 14, 2025
Merged

Add job cleaner excluded queues that can be configured through pilot#1004
brandur merged 1 commit into
masterfrom
brandur-ommitted-queues

Conversation

@brandur

@brandur brandur commented Aug 10, 2025

Copy link
Copy Markdown
Contributor

Add a new pilot function that lets it dictate that certain queues should
be excluded from the standard cleaning process that manages retention.
Along with the JobDeleteBefore driver function picking up a new
QueuesExcluded parameter, we also add its inverse of QueuesIncluded
which lets us delete jobs from a specific set of queues.

@brandur brandur force-pushed the brandur-ommitted-queues branch from 16c4468 to 8cd9ee1 Compare August 10, 2025 05:08
@brandur brandur requested a review from bgentry August 10, 2025 05:25
@brandur brandur force-pushed the brandur-ommitted-queues branch 7 times, most recently from a977e1c to c31a4cb Compare August 10, 2025 20:26
Comment on lines +1044 to +1057
// I ran into yet another huge sqlc SQLite bug in that when mixing
// normal parameters with a `sqlc.slice` the latter must appear at
// the very end because it'll produce unnamed placeholders (?)
// instead of positional placeholders (?1) like most parameters. The
// trick of putting it at the end works, but only if you have
// exactly one `sqlc.slice` needed. If you need multiple and they
// need to be interspersed with other parameters (like in the case
// of `queues_excluded` and `queues_included`), everything stops
// working real fast. I could have worked around this by breaking
// the SQLite version of this operation into two sqlc queries, but
// since we only expect to need `queues_excluded` on SQLite (and not
// `queues_included` for the foreseeable future), I've just set
// SQLite to not support `queues_included` for the time being.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😕

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, ugh :( We should chat about this, but using Sqlc for SQLite might've been a mistake. I was somewhat optimistic that I'd be able to start landing some fixes over there, but the one fix I got in is still unreleased months later, and a few other high quality patches from others are ignored. I'm honestly not 100% sure what to do because I don't really see any good alternatives. Options are kind of "bad" or "worse".

Add a new pilot function that lets it dictate that certain queues should
be excluded from the standard cleaning process that manages retention.
Along with the `JobDeleteBefore` driver function picking up a new
`QueuesExcluded` parameter, we also add its inverse of `QueuesIncluded`
which lets us delete jobs from a specific set of queues.
@brandur brandur force-pushed the brandur-ommitted-queues branch from c31a4cb to a32caa8 Compare August 14, 2025 07:17
@brandur

brandur commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

Thanks!

@brandur brandur merged commit 7be36dd into master Aug 14, 2025
10 checks passed
@brandur brandur deleted the brandur-ommitted-queues branch August 14, 2025 07:19
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