Fix workflow throughput admission#5791
Draft
akshay326 wants to merge 5 commits into
Draft
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Someone is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
Co-authored-by: Cursor <cursoragent@cursor.com>
6 tasks
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
This PR fixes an overload-control bug in the database-backed async workflow path: the admission permit was released after
202 Acceptedwhile execution continued in the web process. The permit now remains held until inline execution finishes, so overload produces explicit backpressure instead of unbounded in-process work.It also applies admission control to session-backed async requests, adds coverage, and documents a production-grounded method for measuring workflow throughput and locating bottlenecks.
Scope
workflow_execution_logs.ended_at;202/secis admission throughput only.Testing
bun run check:api-validationbun vitest run app/api/workflows/[id]/execute/route.async.test.ts lib/core/async-jobs/backends/database.test.ts— 58 tests passedbun run type-checkgit diff --checkReview focus
workflow.execution.countas secondary until production export and terminal-path coverage are validated.Follow-up experiments
The next evidence-gathering step is a fixed-workload local/staging matrix: work-duration sweep, database backend versus Trigger.dev, DB pool pressure, tenant fairness, sync/SSE web pressure, executor memory/fan-out, and Redis/storage/external dependency degradation. The goal is to prove the binding resource before proposing a fix.
Checklist