fix(knowledge): wait for embedding admission instead of deferring documents for an hour - #7720
Merged
Merged
Conversation
…uments for an hour Every embedding batch on the indexing path waited at most five seconds for the deployment's shared admission bucket. Twenty concurrent documents fanning out eight batches each queue for minutes behind the configured per-minute budget, so under load most batches timed out, the document stopped, and it was re-dispatched with a delay that started at a minute and doubled to an hour. The bucket's own estimate of when capacity returns was only a floor under that ladder. During a bulk sync this produced thousands of hour-long deferrals for a limiter we run ourselves, while the provider was healthy. The knowledge path now waits up to a minute for admission, which is cheaper than the re-dispatch it replaces and still bounded by the per-request retry budget. The request bucket admits 64 concurrent starts instead of 8, so documents that begin together no longer lose a race for slots while the token budget sits unused. When an admission wait still expires, the document resumes after the bucket's stated wait, clamped to 10 to 60 seconds with jitter, and the yield counts against the processing-slice budget rather than the provider-failure attempts, since the provider did nothing wrong. The deadline path now carries the bucket's last stated wait so that estimate is available to the scheduler. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
|
…line The bucket's stated wait is stored as an absolute instant so a deadline hit after a sleep carries the remainder, not the original duration. A test pins the knowledge admission wait below the retry budget the processing deadline reserves for each request. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Testing
vitestacrosslib/knowledge/documents,lib/core/rate-limiter,lib/embeddings,background/knowledge-processing: 828 passingbun run type-check,bun run lint,bun run check:audits,docs-manifest:checkpassChecklist