Repository navigation
Review skill: check the lifetime of what jobs on other threads use - #128365
alexey-milovidov merged 1 commit into
Conversation
Add three rules to the agent instructions: - `.claude/skills/review/SKILL.md`, triggered expansion "Jobs on other threads": list everything a scheduled job uses, including a lambda or `std::function` it calls, and check that each outlives the join on every exit after the first schedule (a later schedule throws, the scheduling thread throws while doing its own share, an early return). The joiner is declared after everything the jobs use, and a closure that refers to the pool is captured by value. - Same file, "A fix is new code": a re-review covers the code changed since the previous review, including the fixes for earlier findings, with the same gates as the first review. - `.claude/CLAUDE.md`: the same lifetime rule for authors. The last round of ClickHouse#126625 moved the job body of `loadStatisticsOfPartsInParallel` into a closure declared after the pool, called by the jobs through `[&]`. A later schedule that threw destroyed the closure before the pool joined the jobs (fixed by ClickHouse#127911). The AI review approved that round with "the prior findings are addressed", and Stress tests, the only ones that inject thread creation failures broadly, were green on the final head. Asked for in ClickHouse#127911 (comment) The reply there listed "`wait` rethrows" as an exit; it is not in the rule because `ThreadPool::wait` and `waitForAllToFinishAndRethrowFirstError` join all jobs before rethrowing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own review (3 nits, not blocking).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261031-112200 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261031-110300 |
|
cc @Algunenano, could you review this and add the |
|
Workflow [PR], commit [7cb8f1c] Summary: ✅ AI ReviewSummaryPR #128365, reviewed at Final VerdictStatus: ✅ Approve. |
f760cbb
Related: #127911
Related: #126625
Related: #95818
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required: changes only the agent instructions in
.claude/.Description
Asked for in #127911 (comment).
.claude/CLAUDE.mdgets the same lifetime rule for authors.Why: the last round of #126625 moved the job body into a closure declared after the pool and called by the jobs through
[&], so a later schedule that threw destroyed it before the pool joined them (ASan stack-use-after-scope, fixed by #127911). The AI review approved that round with "the prior findings are addressed"; the Stress tests, which rarely inject thread creation failures, were green.Validation: applied literally, the check flags the code of #126625 and passes the #127911 fix and two sites fixed by #95818. It also flags
S3TablesCatalog::getTables, which declarestablesandmutexafter the runner whose jobs capture them by reference (RestCatalog::getTablesdeclares them before); I did not change it in this PR.Workflow [PR]
Sync PR [sync-upstream/pr/128365]
Version info
26.11.1.995-master(included in26.11and later)