docs: combined concurrency limits and queue gates - #4853
Conversation
|
WalkthroughThe OpenAPI specification adds combined concurrency override and reset endpoints. It documents combined concurrency state on Merge Risk: 🔵 Low · up to The new queue-concurrency guide can lead users to assume a combined cap covers all runs, though unkeyed runs bypass it. Clarify that the cap applies collectively to keyed runs before merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description accurately summarizes the documentation changes, but it omits most sections required by the template, including the issue reference, checklist, testing details, changelog, and screenshots.
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
05bef1a to
7998d68
Compare
af1ed4f to
ab4c607
Compare
e73840d to
34b2cfb
Compare
@trigger.dev/build
trigger.dev
@trigger.dev/core
@trigger.dev/python
@trigger.dev/react-hooks
@trigger.dev/redis-worker
@trigger.dev/rsc
@trigger.dev/schema-to-json
@trigger.dev/sdk
commit: |
34b2cfb to
947879a
Compare
947879a to
2e0ae55
Compare
2e0ae55 to
1772166
Compare
99fc054 to
7cd93f1
Compare
7cd93f1 to
2250f8e
Compare
2250f8e to
b70f42a
Compare
b70f42a to
b4d89eb
Compare
b4d89eb to
56a9526
Compare
…body required The gates intro promised a task-wide cap the keyed example does not deliver (a concurrencyKey splits the home queue per key); the combined object is emitted on every queue with null fields rather than omitted; and both reset endpoints reject a zero-length body, so the body is required. Also restores the example that drifted off overriddenAt.
A Use cases index links each goal to its section, the multi-queue section names the home queue and gate concepts once and gives each pattern its own worked example (per-tenant cap across tasks, global cap for a shared resource via a combined-only queue, pinned-key shared pool), and the per-key-except-combined rule gets a warning callout. Folds in the simplified wording and removes self-hosting notes.
The combined limit only counts keyed runs, so the shared-resource example now shows the keyed trigger and warns that keyless runs bypass the cap, pointing those cases at the pinned-key pool.
56a9526 to
eb33462
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 390c0511-37dd-471c-8ca9-6c0d7d3ac992
📒 Files selected for processing (1)
docs/queue-concurrency.mdx
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: code-quality / code-quality
- GitHub Check: Build and publish previews
- GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (2)
Add crumbs as you write code — not just when debugging.
📄 CodeRabbit inference engine (AGENTS.md)
Files:
docs/queue-concurrency.mdx
MDX documentation pages must include frontmatter with title (required), description (required), and sidebarTitle (optional) in YAML format Use Mintlify components for structured content: , , , , ,
📄 CodeRabbit inference engine (docs/CLAUDE.md)
Files:
docs/queue-concurrency.mdx
docs/queue-concurrency.mdx🧠 Learnings (1)
📚 Learning: 2026-04-30T20:30:29.458Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3226
File: docs/ai-chat/quick-start.mdx:13-13
Timestamp: 2026-04-30T20:30:29.458Z
Learning: In this repo’s documentation MDX files (`docs/**/*.mdx`), use `ts` and `tsx` (not `typescript`) as the code-fence language tags for TypeScript/TSX snippets. Do not flag `ts`/`tsx` code-fence language tags as incorrect in any docs MDX file, since this is the site-wide Mintlify-compatible convention.
Applied to files:
docs/queue-concurrency.mdx
|
|
||
| `concurrencyKey` gives every key value its own copy of the queue, each with the queue's full `concurrencyLimit`. That means the queue's total concurrency grows with the number of active keys: ten active users on a queue with `concurrencyLimit: 5` can run 50 at once. | ||
|
|
||
| To bound the whole queue, set `combinedConcurrencyLimit`. Each key still gets at most `concurrencyLimit`, and the queue as a whole never exceeds the combined limit across all keys: |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Limit the combined-cap claim to keyed runs.
Line 174 states that the whole queue never exceeds combinedConcurrencyLimit. Line 188 states that unkeyed runs bypass that limit. A mixed workload can therefore exceed the combined limit in aggregate.
Describe combinedConcurrencyLimit as a cap for keyed runs collectively. Apply the same qualification to the warning at Lines 191-192.
Proposed wording
-Each key still gets at most `concurrencyLimit`, and the queue as a whole never exceeds the combined limit across all keys:
+Each key still gets at most `concurrencyLimit`, and keyed runs collectively never exceed the combined limit:📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| To bound the whole queue, set `combinedConcurrencyLimit`. Each key still gets at most `concurrencyLimit`, and the queue as a whole never exceeds the combined limit across all keys: | |
| Each key still gets at most `concurrencyLimit`, and keyed runs collectively never exceed the combined limit: |
Summary
Documents the queue concurrency features shipping in this stack: the
combinedConcurrencyLimitqueue option that caps a keyed queue across all of itsconcurrencyKeyvalues, queue gates (arrayqueuesyntax for holding a slot in more than one queue), and the combined override/reset SDK methods and endpoints.The concurrency guide gains sections on combined limits and gates with self-hosting notes for the server flags, the OpenAPI spec gains the two combined endpoints and the
concurrency.combinedresponse field, and the management reference gains pages for both new endpoints.Stacked on #4830.