fix(billing): let a slow ledger read finish instead of blocking execution at the singleflight default - #8146
Conversation
…tion at the singleflight default
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
…e deadline from it
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
coalesceLocally. That helper's default settle deadline is 30 s and exists to bound a hung producer. The gate's producer is a ledger sum over the payer's billing period; for a large organization that is millions of rows and, from a cold cache or under heavy I/O, legitimately takes longer than 30 sCoalesceSettleTimeoutError, the preprocessing step could not determine limits and blocked the run ("Unable to determine usage limits. Execution blocked for security"), while the timed-out read kept running detached and the next caller started a second read of the same ledger alongside itUSAGE_GATE_SETTLE_TIMEOUT_MS(120 s), above any statement ceiling the deployment applies: a slow read waits and finishes, the database's own statement timeout still ends a stuck one and that failure is reported as before, and only a connection that never answers is given up on by the gateType of Change
Testing
bun run lint,check:audits(47 audits),docs-manifest:check,type-checkpassChecklist