Repository navigation
Revert "Use a lock-free queue for asynchronous logging" - #112793
Merged
alexey-milovidov merged 1 commit intoJul 31, 2026
Merged
Conversation
Contributor
1 task
alexey-milovidov
pushed a commit
that referenced
this pull request
Jul 31, 2026
`clickhouse-local` never stopped the asynchronous logging threads (one `AsyncLogger` per log channel plus `AsyncTextLog`) started by `Loggers::buildLoggers`. Unlike the server, where `~BaseDaemon` calls `stopLogging`, `LocalServer` had no such call, so `OwnAsyncSplitChannel::close` never ran and the threads were still consuming the log queues while `exit` ran static destructors. Under ThreadSanitizer the unjoined threads surface at exit as a `thread leak` report on `AsyncLogger`, and since sanitizers run with `abort_on_error=1` the report aborts `clickhouse-local`. That made the `Scraping system tables` CI step report every `system.*_log` dump of an affected run as failed. The `amd_msan` `use-of-uninitialized-value` in `OwnPatternFormatter::formatExtended` is the same shutdown race caught in the act: the `AsyncLogger` thread was still formatting a message using Poco's static priority-name strings after `exit` had destroyed them. The fix mirrors `BaseDaemon`: `~LocalServer` stops and joins the asynchronous logging threads (`OwnAsyncSplitChannel::close` flushes the queues before joining), so they never overlap with static destruction. Originally submitted as #112753 against the first version of this change. Folded in here because that version was reverted in #112793 and is reintroduced by this pull request, so the fix must land together with it. Closes: #110816
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #107363
Version info
26.8.1.545(included in26.8and later)