feat: limit accepted attachment work and add queue overload bench
Reject uploads with 429 at [uploads] max_unfinished_jobs, counted by the existing partial indexes in the membership block. Add the bench_queue profile, hypotheses H1-H9 and the fifth failure-stand API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -471,6 +471,8 @@ async def _statements(engine, action) -> list[str]:
|
||||
[
|
||||
("lock_due_jobs", "'queued'"),
|
||||
("count_published", "'queued'"),
|
||||
("count_unfinished", "'processing'"),
|
||||
("count_unfinished", "'queued'"),
|
||||
("lock_stale_pending", "'pending'"),
|
||||
("get_staging_candidates", "'ready'"),
|
||||
],
|
||||
@@ -487,6 +489,8 @@ async def test_status_is_a_constant_in_statement(
|
||||
await uow.jobs.lock_due_jobs(now=NOW, limit=1)
|
||||
elif method == "count_published":
|
||||
await uow.jobs.count_published()
|
||||
elif method == "count_unfinished":
|
||||
await uow.jobs.count_unfinished(limit=1)
|
||||
elif method == "lock_stale_pending":
|
||||
await uow.attachments.lock_stale_pending(
|
||||
attachment_id=user_dto().id,
|
||||
|
||||
Reference in New Issue
Block a user