Repository navigation
perf: shorten native scan claim transactions - #3698
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codex review: blocked before merge. Reviewed September 14, 2026, 7:28 PM ET / 23:28 UTC. ClawSweeper reviewWhat this changesRead ordinary security-scan queues directly inside the claim transaction while retaining paginated fallback for blocked legacy jobs. Merge readiness⛔ Blocked before merge - 1 item remains No blocking findings. This remains a useful, focused contention mitigation: current main bounds queue reads but still performs nested query calls. The collaborator-authored PR should remain open. Priority: P2 Review scores
Verification
How this fits togetherClawHub scan workers request queued security jobs from the Convex backend. The claim transaction selects eligible jobs and issues exclusive leases before workers retrieve artifacts and scan them. flowchart TD
A[Scan worker request] --> B[Worker token check]
B --> C[Select ready queue jobs]
C --> D[Direct native read]
C --> E[Legacy or catalog pagination]
D --> F[Recheck eligibility and issue lease]
E --> F
F --> G[Worker retrieves scan artifacts]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep queue selection and leasing atomic, and qualify higher worker concurrency with production measurements. Do we have a high-confidence way to reproduce the issue? No reviewer-established reproduction: the body supplies a concrete concurrent local-Convex scenario, but OCC failure rates are workload-dependent and were not rerun. Is this the best way to solve the issue? Yes, as a bounded mitigation: removing nested-call overhead targets the implicated transaction. Worker retries already exist; queue sharding would be a broader change unsupported by the current measurements. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 595afc09a183. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Concurrent scan workers can exhaust Convex transaction retries while claiming the same queue head. Production request IDs matched
claimQueuedJobsInternalOCC failures. Native claims now read each source directly within the mutation, removing nested-query dispatch overhead; blocked legacy GitHub records retain the existing paginated fallback. Priority ordering, rollout gates, catalog admission, leases and scan settings are unchanged.Paired proof on a disposable local Convex backend at
http://127.0.0.1:3318, seeded with 600 fake queued bulk jobs: eight callers making 32 paced requests went from 22 successful claims / 10 OCC failures in 20.41 seconds to 32 successful claims / zero failures in 9.90 seconds. Every claimed ID was unique; read budgets for limits 1, 4 and 16 passed. An unpaced saturation test still had conflicts (15 failures before, 12 after), so higher production capacity requires fresh measurement. Temporary local seed functions are excluded from this PR.Validation: 117 scanner tests pass; the three direct-read regression cases fail on the old implementation.
bun run ci:static,bun run ci:unit(6,690 tests),bun run ci:types-build, and schema/CLI/Convex TypeScript checks passed. Independent autoreview passed with no actionable findings.