Skip to content

Keep the crash-report channel of clickhouse-local reachable - #115102

Merged
azat merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-local-fatal-report-channel
Oct 5, 2026
Merged

azat merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-local-fatal-report-channel

Conversation

@groeneai

@groeneai groeneai commented Aug 17, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fixed missing crash reports of clickhouse-local when neither stdin nor stderr is a terminal: a fatal signal printed nothing, and --client_logs_file was not written.

Description

On 26.8, clickhouse-local with neither stdin nor stderr on a terminal exits 134 on a fatal signal with empty stderr, and --client_logs_file is not written.

ClientApplicationBase::init binds the signal listener's logger to a channel over stderr and --client_logs_file, then buildLoggers re-channels every existing logger to the configured channels, which have no console in that case. buildLoggers now leaves the loggers it is told to keep, and clickhouse-local keeps the listener's logger. It is renamed from ClientBase, so the other ClientBase logging still follows the configuration. The report no longer goes to a --logger.log file.

In CI this made aborts undiagnosable, e.g. PR 108078.

Test 04916_local_fatal_signal_report fails on master (no report, no client log file).


Workflow [PR]
Sync PR [sync-upstream/pr/115102]

Version info

  • Merged into: 26.10.1.1548-master (included in 26.10 and later)

@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (click to expand)

Five review rounds, each with an independent cold code review plus a second-model gate whose
findings I adjudicate against measurement. 26 distinct findings: 19 accepted and fixed,
4 refuted with evidence, 3 dropped as harness artifacts or without a reachable consequence.

❌ Blockers fixed (r1-r4)

  • OwnSplitChannel::log evaluated logs_queue->isNeeded(...) under logs_queue == nullptr &&,
    selecting the dereference rather than guarding it. Reachable with --logger.async=0 and no
    log destination. Three earlier drafts of this description published the opposite claim ("dead
    by short-circuit"); the guard also needed the text_log term its asynchronous counterpart
    already has, or system.text_log silently loses records.
  • The new test wrote a core dump into the directory CI harvests, which takes the first three
    files it finds and would evict a real crash's core. Measured: 462 KB core.* under
    ulimit -c unlimited, byte-identical stdout and stderr either way, so no oracle could see it.
  • A console destination whose level excludes fatal (console_log_level=none, which parses to 0)
    satisfied a mere "a console child exists" test, so the only working stderr route was deleted.
    The predicate now reads the same two keys with the same fallback as the child's own level.
  • A failing --client_logs_file silenced the whole report: Poco::SplitterChannel::log walks
    children in order without catching a throw, and SimpleFileChannel opens lazily inside
    log(). Destinations that touch the filesystem now go last.

⚠️ Majors fixed: an untagged runtime cliff against the hard 600 s per-case timeout; a
duplicate report on a terminal; and three oracles that could not fail if the property they
existed to pin regressed (--client_logs_file uncovered, the de-duplication branch never
executed, the fold assertion unable to observe its own subject).

💡 Refuted with evidence, not prose

  • A fatal record can be dropped by the asynchronous log queue. Real, and unchanged by this PR:
    the removal of the client's own console child happens only when the configured split has a
    console child, and in exactly that configuration the pre-fix binary routed the report through
    that same split, built from the same key and default. So the behaviour at
    --logger.async_queue_max_size=1 is identical before and after, and no configuration loses a
    stderr route it previously had. Fixing it as first prescribed measured strictly worse: because
    logger.async defaults to true, it reintroduced a duplicate report on the ordinary no-flag
    interactive path, and the proposed regression arm was non-deterministic in both directions
    (10 runs per binary), i.e. a flaky test. Truncation is confined to a queue depth of 1; sweeps
    at 2, 3, 4, 16, 64, 256 and the 65536 default keep the closing line.
  • The fatal-only level restriction has no live oracle. It has one: the signal listener also
    logs non-fatally on this logger, and the destructor writes a stop record unconditionally, so
    widening the level makes a successful SELECT 42 print to stderr. That mutation was run and
    does redden.
  • A fatal block could trip the harness SERVER_DIED detector. The necessary step is a level
    marker that the bare console channel never writes. Zero occurrences across all arms, with a
    working positive control.

Every fix is mutation-tested: each reverted individually, rebuilt with the Build ID verified to
change, and run through the real runner to confirm it reddens exactly one assertion and no other.

Session id: cron:clickhouse-review-slot-10:20260817-082200

@clickhouse-gh

clickhouse-gh Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d02424d]

Summary: ✅


AI Review

Summary

This PR correctly fixes the buildLoggers re-channeling bug by keeping clickhouse-local's dedicated fatal logger on its own splitter, so the earlier post-buildLoggers hole is gone. But one previously-known failure path is still present: SignalListener::onFault still performs fresh logger-registry work on the fatal-signal path, and the new regression test now only aborts an idle sleep() query, so it no longer covers that remaining window. Because the patch still allows some real crashes to lose their report, I cannot approve it as a complete fix yet.

Findings

⚠️ Majors

  • [dismissed by author -- https://github.com/ClickHouse/ClickHouse/pull/115102#discussion_r4177734210] [src/Common/SignalHandlers.cpp:641] SignalListener::onFault still starts by constructing ThreadStatus, and ThreadStatus::ThreadStatus still calls getLogger("ThreadStatus") at src/Common/ThreadStatus.cpp:158. If the faulting thread dies while holding Poco's logger-registry mutex, the listener thread blocks on that lookup and the crash report is still lost, so the "fatal report stays reachable" invariant remains false in exactly the real-crash window the current test avoids. Suggested fix: restore the earlier listener-thread warm-up (construct ThreadStatus once in SignalListener::run) or otherwise remove logger-registry work from onFault.
Tests
  • ⚠️ Add the smallest focused regression or measurement that aborts while the faulting thread is inside logger registration or first DateLUT initialization. tests/queries/0_stateless/04916_local_fatal_signal_report.sh only kills the process while it is idling in sleep(), so it cannot falsify the remaining deadlock window.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    • Remove the remaining logger-registry work from the fatal-reporting path, or prove that the logger-registry-lock / first-DateLUT windows cannot suppress the report.
    • Add focused evidence that exercises that remaining path, not only the idle sleep() case.

LLVM Coverage Report

Measured on commit d02424d.

Metric Baseline Current Δ
Lines 88.20% 88.20% +0.00%
Functions 92.10% 92.10% +0.00%
Branches 79.60% 79.60% +0.00%

Changed lines: Changed C/C++ lines covered: 14/14 (100.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Aug 17, 2026
@groeneai

groeneai commented Aug 17, 2026 •

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. clickhouse-local runs SELECT 'ready'; SELECT sum(sipHash64(number)) FROM numbers_mt(1e11) with stderr on a pipe; the harness waits for ready on stdout, sends SIGABRT, and asserts rc=134 before reading the oracle. Not a rate-based repro. The readiness gate is required: SELECT sleep(N) is capped at 3 s and a count() can finish before the signal, and either yields an arm that measures nothing.
b Root cause explained? Yes. ClientApplicationBase::init binds the SignalListener's logger to a SplitterChannel holding a ConsoleChannel. LocalServer::processConfig then calls buildLoggers, whose re-channel loop replaces the channel of every already-created logger by name, including that one. The replacement has no console channel unless logger.console is set or a tty is attached, and in CI stderr is a pipe, so the listener formatted the report into a channel with no destination.
c Fix matches root cause? Yes. It repairs the step that destroys the state (the re-channel), not the crash site. No widened bound, no tag, no defensive guard, no data reduction. The alternative of excluding the name from the generic loop was rejected: the name is shared with an ordinary LOG_DEBUG, and a hardcoded name list in generic logging code is the shape maintainers reject.
d Test intent preserved / new tests added? New test 04916_local_fatal_signal_report.sh: 8 abort arms (no flags, logger.log, --client_logs_file, an unwritable --client_logs_file with and without logger.console=1, logger.async=0, logger.console=1, logger.console=1 + console_log_level=none), a text_log-only arm, and a success arm. No existing test weakened, no other .reference touched. Parallel-safe with no no-parallel: every path is scoped to $CLICKHOUSE_TMP/04916_${CLICKHOUSE_DATABASE}. A .sh test rather than SQL or a gtest because an abort is not expressible in SQL. Tagged long: the deadly handler can sit in signalHandler for up to 303 s, and the tag both exempts the test from TEST_MAX_RUN_TIME_IN_SECONDS = 180 and cuts the flaky-check rerun count. Also tagged no-msan: the per-case timeout is a hard 600 s that long does not raise (args.timeout default at clickhouse-test:6396-6399, enforced at :3726, consulted by none of its three uses), each arm waits on the handler, and MSan unwinding is recorded at 101 s for one report (SignalHandlers.cpp:171) - 9 arms have no headroom. What the test pins is logger channel wiring, identical on every build, so debug, TSan and ASan+UBSan still cover it (skip matrix verified against the runner's own tag parser, with a negative control). Measured per-run wall clock 38.9-42.9 s across 100 runs.
e Both directions demonstrated? Yes. Abort arm: base stderr 0 bytes / 0 reports, fixed stderr 8,544 bytes / 1 report with symbolized frames. Success arm: SELECT 42 prints 42 and 0 bytes on stderr on both binaries. Through the real runner the test is [ OK ] (38.1 s) on the fixed binary and red on the pre-fix one, with 13 oracle lines flipping 1 -> 0 and 0 bytes of stray script stderr. Non-vacuous: on the pre-fix binary signalled 134 holds on all 8 abort arms, cores 0 holds, and logfile file report 1 still holds, so the abort really happened and the log-file destination still worked - only stderr routing and the client's own fatal file differ.
f Fix is general across code paths? Yes, and the carrier set is closed: Client and LocalServer are the only ClientApplicationBase subclasses, LocalServer and BaseDaemon the only Loggers subclasses. Measured: clickhouse-client unchanged and still reporting (3,814 -> 3,819 bytes, 1 report both); the --server_logs_file branch unchanged (8,564 -> 8,554 bytes, 1 report both); BaseDaemon unaffected, and the server binary neither calls the new method nor links ClientApplicationBase; the embedded client rejects --client_logs_file already. The console-gate predicate extracted for this fix is shared with buildLoggers and updateLevels so it cannot drift; A/B on a real server across logger.console 1, 0 and unset is byte-identical (10,330 / 141 / 141 bytes, both binaries).
g Fix generalizes across inputs? Yes for the axes that exist on this path: no flags, --client_logs_file, --server_logs_file, a configured logger.log, logger.async 0 and 1, tty and pipe stderr, logger.console 1/0/unset, logger.console_log_level default vs none, and a text_log destination with no channel configured. --client_logs_file was silently inert on local before (the file was never created) and now carries the report, pinned by its own arm - and its unwritable case is pinned by two more, since a destination that throws is a distinct input from one that merely exists. Type wrappers do not apply: no data path is touched.
h Backward compatible? Yes. No settings, no formats, no on-disk state, so no SettingsChangesHistory.cpp entry and nothing to version. A destination configured meanwhile is kept rather than replaced, so no existing logging setup changes: with a configured logger.log the report still lands in the file and is additionally written to stderr. Removing that additive fold makes the file lose the report entirely (mutation-tested), which is why it is not a bare setChannel.
i Invariants and contracts preserved? The SignalListener's logger keeps at least one reachable route to stderr for the whole process lifetime except the few statements between buildLoggers' re-channel loop and the restore that follows it, and at most one whenever the configured route itself admits PRIO_FATAL - the weaker "a console child exists" test is not sufficient, because buildLoggers gives that child a configurable level and console_log_level=none parses to 0, below every priority. The two properties are pinned by separate arms. The stderr guarantee holds under a failing destination too, which needs ordering rather than a predicate: Poco::SplitterChannel::log walks children sequentially without catching what one throws, and SimpleFileChannel opens lazily inside log(), so a --client_logs_file on a bad path throws on the first record and skips every later child. Destinations that touch the filesystem therefore go last. The residual is deliberate and matches the pre-fix binary: a failing file loses its own copy (a bad path never produced a file there either); what it can no longer do is take stderr with it. The method is null-guarded on both members, holds no lock, and is idempotent by construction rather than by call-site count - a synthetic second call adds no second report, while removing the guard makes the splitter contain itself and deadlocks the handler on Poco's non-recursive FastMutex. Poco::SplitterChannel::addChannel calls duplicate(), so retaining the channel pointer is refcount-safe. Separately, system.text_log records are no longer dropped when the channel list is empty, so the synchronous guard now matches its asynchronous counterpart.

Coverage is mutation-tested, not asserted. Each mutation was built (build RC checked and Build ID verified to change) and run through the real runner; each reddens exactly one arm and leaves the others green: remove the additive fold -> logfile file report 1 -> 0; widen PRIO_FATAL to PRIO_TRACE -> success stderr empty 1 -> 0; remove the ulimit -c 0 guard -> the cores rows 0 -> 1; insert a statement boundary between kill and wait -> the jobcontrol quiet rows 1 -> 0; weaken the console predicate to mere existence -> console_none stderr report 1 -> 0; drop the text_log term -> textlog rows 1 -> 0; disconnect the --client_logs_file child -> clientlog file report 1 -> 0 while logfile file report stays 1; remove the stderr de-duplication -> console stderr report 1 -> 2; revert the destination ordering -> clientlog_unwritable_console stderr report/stderr signal 1 -> 0 while the writable clientlog arm and the other 7 arms stay green, which is what separates an ordering assertion from a file-channel one (the reverted binary's Build ID is bit-identical to the pre-ordering build, so the mutation is exactly that delta). 100/100 runs with and without randomized settings, and 0 stray core.* files under ulimit -c unlimited.

Session id: cron:clickhouse-impl-slot-5:20260817-014600

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @Algunenano @yakov-olkhovskiy, could you review this? ClientApplicationBase::init binds the signal listener's logger to a splitter over stderr, then LocalServer::processConfig calls buildLoggers, whose per-name re-channel loop replaces that logger's channel with one that has no console child unless a tty is attached, so a fatal signal in clickhouse-local printed no report at all whenever stderr was redirected.

@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Aug 17, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - b112165

Every 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 CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Build (arm_tidy) / gtest_merge_join_starved_totals.cpp.o inherited master build break, not this diff (no matching function for call to '__construct_at'; this PR's 8 files contain no reference to the unit test, TableJoin or JoinAnalyzeMode) #115087 (ours, merged) - merged master @ 1d5bc68 to pick it up
Finish Workflow / new_tests_check.py consequence of the above: all four Bugfix validation per-arch jobs were DROPPED/SKIPPED for want of a binary, so the hook correctly reported that no per-arch job validated the bug #115087 (ours, merged) - same owner, resolved by the same master merge

The build predates the fix: #115087 merged at 10:03Z and is not an ancestor of the previous head, and
master builds have been green since 10:10Z. I merged master (no rebase, no content change: the source
delta is byte-identical, same git patch-id, and no submodule pin moved) and pushed as a strict append
b1121656691eac8..1d5bc681e65edec, so CI re-runs with the fix present.

The Style check failure reported on the previous head was PR-caused and is already fixed in this PR
at b1121656691eac8 (a bare SYSTEM FLUSH LOGS in the new test now names its log).

Session id: cron:our-pr-ci-monitor:20260817-103000

@clickhouse-gh

clickhouse-gh Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing d02424d74 with master 2493c465d (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

24 translation units recompiled, 156 s compile time in total, 24 of them have a recent master baseline.

Median compile-time ratio to the baselines is ×1.05 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost +8.6 s (+6%) in total before that adjustment.

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

Pushed 8b216f4: the fatal-signal report could be lost to a deadlock, and a TSan-only stall is now tagged out.

The deadlock. SignalListener::onFault constructed its ThreadStatus inside the handler, which resolves a logger; Poco::Logger::getShared takes the registry mutex unconditionally. When the abort landed while the faulting thread already held that mutex (via logQueryFinishImpl -> getLogger("ProcessorProfileLog")), the listener blocked on it and the report was never printed, while the faulting thread spun its full 300 s wait. Constructing the ThreadStatus at the top of run() moves the only in-window resolution out of the window. Emitting a report never touches that mutex (Poco::Logger::log does not lock; LOG_* resolves nothing), so only resolution had to move. Pre-warming does not help: both get and getShared lock before distinguishing hit from miss.

Measured on a TSan build: logger-mutex frames in captured hangs 18 -> 0, and 25/25 runs pass at 81-86 s.

The second commit detaches the faulting query's log queue on the way out. Hoisting the ThreadStatus made it outlive the report, and SIGTSTP reaches the same handler with a handler that returns, so a later report could otherwise point at a finished query's queue.

no-tsan. SIGABRT can interrupt TSan's own runtime mid-SlotLock, after which the handler's first instrumented atomic re-enters it and blocks. HandledSignals::instance is a function-local static, so there is no instrumentation-free path. This is the runtime, not ClickHouse.

The tag is inert under --stress-tests, so I measured that path rather than assuming it: 25/25 pass at 81-86 s through the real runner (7x margin under the 600 s cap), and CI's own stress jobs already ran this test untagged on the previous head and passed it everywhere, worst case 238 s. A reverted-source arm still fails 13 reference lines across 7 arms in stress mode, one run at 661 s, so the assertions keep their teeth and the pre-fix binary really does blow the cap.

Session id: cron:clickhouse-maint-slot-13:20260818-025100

Comment thread src/Client/ClientApplicationBase.cpp Resolved
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 18, 2026
Poco loggers are shared by name: createLogger and getLogger both resolve
through one name-keyed registry, so the object created as "ClientBase" for
the signal listener is the same object ClientBase::initAIProvider later
resolves with getLogger("ClientBase").

Rebinding that object to the crash-report channel at fatal severity after
buildLoggers therefore reconfigured an ordinary consumer as well, and its
LOG_DEBUG on an AI initialization failure was dropped instead of following
the configured sinks. logger.levels.ClientBase stopped taking effect for the
same reason, as did the listener's own non-fatal records.

Measured on three binaries, with the reachability of the consumer confirmed
first through a differently-named logger on the same code path: the record is
present without the restore, absent with it, and present again once the crash
logger has its own name. BaseDaemon and DisksApp already give their listeners
a dedicated logger.

Reported by clickhouse-gh[bot] on ClickHouse#115102.
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 8ff55c0

Every 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 CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_debug, parallel) / 04357_distributed_alias_same_expression flaky, pre-existing on master #108855 (ours, open)

Notes on the one line above:

#108855 "Fix wrong results for duplicate-ALIAS GROUP BY on a Distributed table under two-level
aggregation" is the causal fix: 04357_distributed_alias_same_expression is the regression test
that PR ships, and the failure here is exactly the reference diff that test asserts against.

Not caused by this PR. The diff is the crash-report channel of clickhouse-local (LocalServer.cpp,
ClientApplicationBase.*, SignalHandlers.cpp, Loggers*, OwnSplitChannel.cpp plus its own
04916 test) and greps 0 hits for Distributed|alias|Alias|ActionsDAG|ExpressionAnalyz. The test
is a broad pre-existing flake: 30 days give 206 rows across 167 distinct pull requests with 23 hits
on master, and the runner's own re-run diagnosis on this head reported 10 of 71 repeats failing
with the identical randomized settings.

Session id: cron:our-pr-ci-monitor:20260818-123000

@groeneai groeneai added the groeneai-origin-oranjeai PR origin: delegated from the OranjeAI sibling fleet label Aug 19, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-local clickhouse-local / embedded modes (incl. local file processing). label Sep 4, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Sep 27, 2026
`Stateless tests (amd_debug, flaky check)` failed 2 of 5 runs of
`04916_local_fatal_signal_report`, with `plain stderr report 0` and
`clientlog_unwritable stderr signal 0`, and a third run passed only after
a 300 s stall. Of the stateless jobs only the flaky check runs with the
thread fuzzer (`enable_thread_fuzzer_config`), and `clickhouse-local`
reads it from the environment too: every mutex lock and unlock migrates
the thread and sometimes sleeps while the mutex is held, and `SIGPROF`
sleeps at random points.

An asynchronous `SIGABRT` can then land while the main thread holds a
lock, which it keeps for as long as `signalHandler` waits for the report,
up to 300 s. The report is written by the signal listener thread, which
needs some of the same locks. Reproduced locally with the flaky check's
variables, the gdb stacks of the stalled processes show three ways:

- `pushExtendedMessageToInternalTCPTextLogQueue` constructs `DNSResolver`
  on its first use, and its logger lookup waits for the logger registry
  mutex, held by the main thread in `getLogger`;
- the push waits for the query's logs queue mutex, held by the main
  thread inside a fuzzer sleep in `pthread_mutex_unlock`;
- with a fuzzer `SIGPROF` pending on the main thread, the kernel delivers
  the `SIGABRT` to the listener thread itself, which then prints nothing.

None of these depend on the channel wiring the test checks. Stopping the
fuzzer in the aborted processes, as `03212_thousand_exceptions` does,
removes them: with the flaky check's environment the plain arm stalled in
6 of 200 aborts before and in 0 of 400 after, and the whole test went from
1 failure and 2 stalls in 10 runs (150-448 s) to 20 passes in 20 runs
(87-90 s). With the master binary the test still fails on the same 13
lines.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=115102&sha=26a16543cd87a8ffdf08ace8235ecd57311a0d72&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20flaky%20check%29
ClickHouse#115102

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread programs/local/LocalServer.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 37 queries analysed

no significant changes detected. K_source=6 K_base=30 flagged=0/65

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: e4b1b9a6-69b2-4c5e-baab-45aee0032a58
  • MIRAI run: b07047fa-6771-4f31-a520-486fc7980e43
  • PR check IDs:
    • clickbench_2637805_1790826297
    • clickbench_2637818_1790826297
    • clickbench_2637824_1790826297
    • tpch_adapted_1_official_2637847_1790826297
    • tpch_adapted_1_official_2637861_1790826297
    • tpch_adapted_1_official_2637875_1790826297

Comment thread src/Client/ClientApplicationBase.cpp Outdated
#endif
}

void ClientApplicationBase::restoreFatalLogChannel(bool configured_channel_reports_to_stderr)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very odd, let's instead tell buildLoggers not to reconfigure ClientApplicationBase, and this should significantly simplify the patch, and please remove all unnesessarry code form it, and also squash everything into one commit, do not write too verbose descriptions/comments/commits.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in d02424d, squashed into one commit on current master: buildLoggers now takes a list of loggers to keep, and clickhouse-local keeps the crash report logger, so restoreFatalLogChannel and the console helpers are gone. I also dropped the signal listener and text log queue changes, they only matter when the signal arrives while the faulting thread holds the logger registry lock or is inside the first DateLUT initialization, and the test now signals an idle process. The OwnSplitChannel fix is already in master (#123336).

One behaviour change: the report no longer goes to a configured --logger.log file, only to stderr and --client_logs_file. Keeping it there too would need a step after buildLoggers again, so I left it out; tell me if you want it.

…ckhouse-local`

`buildLoggers` re-channels every existing logger, including the one the signal
listener reports to, so when neither stdin nor stderr is a terminal a fatal
signal printed nothing, and `--client_logs_file` was not written.

CI example: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108078&sha=a84b136d9ac4980b5ff9457eba8f3dbd3b1d09de&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%29
PR: ClickHouse#108078

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai
groeneai force-pushed the fix-local-fatal-report-channel branch from 901a59e to d02424d Compare October 4, 2026 13:02
@groeneai
groeneai requested a review from azat October 4, 2026 13:03

@azat azat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better

@azat
azat enabled auto-merge October 4, 2026 21:11
@azat
azat added this pull request to the merge queue Oct 5, 2026
Merged via the queue into ClickHouse:master with commit 07f97f5 Oct 5, 2026
149 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-local clickhouse-local / embedded modes (incl. local file processing). groeneai-origin-oranjeai PR origin: delegated from the OranjeAI sibling fleet pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants