You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(knowledge): give document processing per-tenant queue lanes (#7937)
Document processing ran through one Trigger.dev queue with a global
concurrency limit and no concurrency key, so a single connector backfill
could hold every slot and leave every other tenant's uploads queued
behind it for hours.
Dispatch now names a lane — interactive for work a person is waiting on,
backfill for connector-driven ingestion — and keys each run by the
entity that owns the knowledge base, so the limit applies per tenant
copy of the queue rather than fleet-wide.
- Key on the owning entity, not the workspace: an organization-scoped
knowledge base carries a null workspace id and would otherwise share
one bucket with every other such tenant. Owned scopes reuse
resourceScopeKey so tenant identity keeps one spelling.
- Stamp the lane on the payload so quota and capacity continuations
resume in the lane they were admitted against instead of promoting
themselves out of the backfill ceiling.
- Parse an absent or unrecognized lane as backfill rather than throwing,
so payloads written before the lanes existed and payloads stamped by a
newer version mid-rollout cannot burn a run's retry budget.
- Keep interactive work on the pre-existing queue name; a queue the
running worker has not registered parks its runs in PENDING_VERSION,
and the app deploys separately from the worker.
- Stop absorbing a rejected backfill chunk in-process: those documents
are reported failed and reclaimed by the stuck-document sweep instead
of outlasting the connector lease they run under.
KB_CONFIG_CONCURRENCY_LIMIT: z.number().optional().default(20),// Per-tenant concurrent document-processing runs in the interactive lane
463
+
KB_CONFIG_BACKFILL_CONCURRENCY_LIMIT: z.number().optional().default(20),// Per-tenant concurrent document-processing runs in the connector-backfill lane
463
464
KB_CONFIG_EMBEDDING_CONCURRENCY: z.number().optional().default(8),// Concurrent embedding API requests within one embed call
464
465
/** Deployment operating budgets shared by every caller using the same provider credential. */
0 commit comments