Repository navigation
fix(batch): let recording admission catch up with pending work - #24494
Conversation
Drain bounded configurable pages with configurable concurrency and immediately repeat full pages after yielding. Defer no-op admission results transactionally so they cannot pin the due head; preserve retry and partial polling delays. Failure-Class: FC-drain-rate-equals-arrival-rate
Drain bounded configurable pages with configurable concurrency and immediately repeat full pages after yielding. Defer no-op admission results transactionally so they cannot pin the due head; preserve retry and partial polling delays. Failure-Class: FC-drain-rate-equals-arrival-rate
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
1 issue found across 6 files
Confidence score: 3/5
- In
backend/utils/batch_pipeline/live.py, the 16-worker default can occupy all of the sharedsync_executorduring GCS reads inadmit_recording, starving other sync work; the 64-worker maximum increases that contention. Keep drain concurrency below the executor capacity or isolate these reads.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/utils/batch_pipeline/live.py">
<violation number="1" location="backend/utils/batch_pipeline/live.py:62">
P1: The new default of 16 drain workers equals the entire shared `sync_executor`, and the max of 64 is four times its size. Each worker holds a sync thread during GCS reads in `admit_recording`. That can starve the sync pipeline and the serving supervisor, which run in the same process. Keep the drain well below the pool size, as the removed comment required.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Keep the idle wait after a privacy-fenced pass without writing fenced rows. Transient admission failures always retry after 60 seconds, including completed partial captures; successful inventory polling retains its existing interval. Failure-Class: FC-drain-rate-equals-arrival-rate
Move environment reads out of the batch stage so the admission policy snapshot boundary remains intact. Drain capacity is process scheduling configuration. Failure-Class: FC-drain-rate-equals-arrival-rate
|
Addressed the Luna R1 findings in
The targeted backend shard passes 201 tests, including all six environment-ratchet tests. The canonical pre-push gate also passes at this head. R2 delta review and new-head CI are being collected. |
Recording admission drains only ten rows before a 20-second idle wait, allowing transcripts to accumulate while batch workers are idle. Default to 100 rows and 16 admission workers, with process configuration clamped to 1..500 (
RECORD_DRAIN_BATCH) and 1..64 (RECORD_DRAIN_CONCURRENCY). Malformed settings use the defaults.A full unfenced page yields to the event loop and immediately starts another pass. Partial/empty pages, failed passes, and passes encountering a privacy fence retain the 20-second wait. Privacy-fenced rows remain untouched. Transactionally defer any row still in
record_pendingafter an ordinary return or exception, preserving admitted rows and longer existing deferrals. Exceptions retry after 60 seconds even for completed partial captures; successful completed inventory polling retains its existing interval.store.duealready orders byavailable_at. Raise its cap to 500 only forrecord_pendingand cover the limits in the existing query driver. Put the capacity environment reader inconfig/record_drain.pyto preserve the batch-stage policy-snapshot boundary. Defaults carry the fix to backend-integration at deployment.Validation at
5511f64c09fc: 201 targeted tests pass (77 live, 53 serving, 65 partial, 6 environment-ratchet). Canonical pre-push passes its 130 changed tests, 817 Firestore guards, type checking, runtime source closure and selected repository checks. These are local source/test checks; deployment throughput remains to be measured. Luna delta review and GitHub CI are pending.Failure-Class: FC-drain-rate-equals-arrival-rate