Repository navigation
Allow allocations in NOEXCEPT_SCOPE catch handler - #110174
Conversation
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-1:20260712-173700 |
|
cc @serxa @azat — could you review? |
|
Workflow [PR], commit [3ba5eef] Summary: ❌
AI ReviewSummaryThis PR changes Findings
Final Verdict
|
CI finish ledger — 7f829f4Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only
This PR touches only Session id: cron:our-pr-ci-monitor:20260713-020000 |
azat
left a comment
There was a problem hiding this comment.
Ok, but:
- remove the useless comment, it can be at max git commit if any
- remove the test
Per @azat review on ClickHouse#110174: the comment belongs at most in the commit message, and the added test is removed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Done: dropped the comment and removed the test. |
|
Squash |
|
And trim the PR description as well, it contains lots of words, while it is enough to include few words + CI report link |
|
Trimmed the description to a one-liner + the CI report link. |
|
You forgot to squash commits |
0c33cae to
fdc6ecb
Compare
|
Squashed into one commit. |
CI finish ledger — fdc6ecbEvery failure below has an owner. None is caused by this PR (a 2-line src/Common/noexcept_scope.h change); all are pre-existing trunk flakies/bugs tracked separately.
Session id: cron:our-pr-ci-monitor:20260713-160000 |
|
Rebase, most of the failures has been fixed. |
When NOEXCEPT_SCOPE is nested inside a DENY_ALLOCATIONS_IN_SCOPE and its body opens a local ALLOW_ALLOCATIONS_IN_SCOPE (e.g. AsyncLoader::spawn wrapping ThreadPool::scheduleOrThrowOnError), a throw from the body unwinds the body's ALLOW scope and restores the outer DENY before the catch handler runs. The catch handler always allocates (tryLogCurrentException formats the message), so under the restored DENY it aborted in debug/sanitizer builds with a misleading LOGICAL_ERROR, hiding the real exception. Run the catch handler under ALLOW_ALLOCATIONS_IN_SCOPE so the real exception is logged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Head branch was pushed to by a user without write access
fdc6ecb to
3ba5eef
Compare
|
Rebased onto current master. |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 3/6 (50.00%) · Uncovered code |
CI finish ledger — 3ba5eefCI fully finished on the rebased head (Finish Workflow SUCCESS; @azat APPROVED). Every failure below has an owner. Not PR-caused: this PR is
Session id: cron:our-pr-ci-monitor:20260713-230000 |
0840bc6
Pulls in #110174 (merged 2026-07-14), which fixes the `AsyncLoader::spawn` `std::terminate` crash (STID: 2028-288e) hit by the AST fuzzer job on this PR's own CI, among ~1400 other commits.
AsyncLoader::spawn wrapped scheduleOrThrowOnError in NOEXCEPT_SCOPE, whose handler is unconditionally std::terminate(). A transient CANNOT_SCHEDULE_TASK from a saturated global thread pool therefore killed the server during table loading, seen 4 times across 4 unrelated PRs and 4 build flavours in 30 days. A spawn must succeed only when nothing else will drain the pool's ready queue, so spawn() now tells three states apart: a worker that entered worker() and is not inside wait() drains the queue now; a worker inside wait() on another pool's job resumes draining once that job runs; neither of those means nobody ever will. The first two use the non-throwing trySchedule, roll back the Pool::workers increment on failure, warn and return false. Only the last keeps the fatal path, byte for byte, because the queued jobs would be stranded and schedule() marks that region non-exception-safe. Two counters are added because Pool::workers also counts a worker still queued in the global pool, which drains nothing, and one blocked in wait(), which cannot take its own pool's jobs. A saturated pool is remembered so the failing thread creation happens once per episode rather than once per queued job, counted by the new AsyncLoaderSpawnFailures event; entering wait() clears it. The regression tests assert which branch was taken rather than only that the process survived, and resolve the ProfileEvent by name so that the file also links against a tree where the event does not exist. That keeps Bugfix validation able to reach a verdict: the before-binary links, runs, and aborts in spawn() as the bug requires. A SQL test cannot reach the line, since on master the whole call sits under blockFaultInjections(). Related: ClickHouse#110174, which removed the mask that hid this exception.
…loader-spawn-noexcept Allow allocations in NOEXCEPT_SCOPE catch handler
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Run the
NOEXCEPT_SCOPEcatch handler underALLOW_ALLOCATIONS_IN_SCOPEso the real exception is logged before terminate.CI report (STID 2573-2cd4): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110144&sha=7c516a74c93c6b69606ae441c4a8792afca0b281&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%29
Version info
26.7.1.892(included in26.7and later)