Repository navigation
Conversation
|
Workflow [PR], commit [8f074a8] Summary: ❌
AI ReviewSummaryThis PR makes running pipelines acquire CPU slots granted after startup and restores retries after lease downscaling. Block merge: the latest retirement synchronization introduces a query deadlock. Focused regression coverage is also missing. Missing context / blind spots
Findings❌ Blockers
Tests
Final VerdictStatus: ❌ Block. Eliminate the retirement/scheduling deadlock and add focused regression coverage for late grants and worker replacement. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units9 translation units recompiled, 12 s compile time in total, 9 of them have a recent master baseline. |
…rows `CPUSlotsAllocation::tryAcquire` throws `RESOURCE_ACCESS_DENIED` when an outstanding CPU request fails, for example after its workload is dropped. The call was outside the `try`, so the graph was not cancelled and processors blocked in `work` did not get the cancellation signal. Co-Authored-By: Claude Opus 5.5 <[email protected]>
serxa
left a comment
There was a problem hiding this comment.
Let me try to address this issue from a different PoV - prevent it from happening in the first place in pushTasks. It might have some performance implications, so let's keep this PR open for now, while I'm experimenting.
When a worker thread fails to renew its CPU lease and downscales, the query is no longer at full capacity, but `slots_outstanding` could stay `false` after `spawnThreads` had reached full capacity earlier. Slots granted later (e.g. when a competing query finishes) would then stay unused if no new demand came from `pushTasks`. Set `slots_outstanding` after `downscale`, under `spawn_mutex` so a concurrent `spawnThreads` cannot overwrite it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
| std::lock_guard lock(spawn_mutex); | ||
| slots_outstanding.store(true, std::memory_order_relaxed); |
There was a problem hiding this comment.
[P1] Do not block retiring workers on the spawning mutex
This introduces a deadlock when a timed-out worker is replaced before its pool job exits. For example, with max_threads = 2, worker 1 times out in CPULeaseAllocation::renew, which releases its lease ID before returning false. Worker 0 can then handle a positive spawn_count, take spawn_mutex, acquire the replacement lease, and call spawnThreads. The pool created in initializeExecution limits running plus queued jobs to num_threads, so scheduleOrThrowOnError waits for one of the two existing jobs to finish. Worker 1 now waits here for the same spawn_mutex before it can return: worker 0 waits for worker 1 to exit, and worker 1 waits for worker 0 to unlock. Query cancellation does not release either wait.
Please keep worker retirement independent of a mutex held across blocking pool scheduling, while preserving the retry-state ordering (for example, use a generation counter for downscaling or change how replacement jobs are scheduled).
|
#125901 covers the issue |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
A query that started while CPU slots were busy now grows its number of threads when other queries release their slots. Previously such slots stayed granted to the query but unused until it finished, and other queries could not use them either.
Workflow [PR]
Sync PR [sync-upstream/pr/125394]