mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:08:38 +00:00
WIP: Use atomics for determining whether trace logging is enabled #35355
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!35355
Loading…
Reference in a new issue
No description provided.
Delete branch "202512-log-atomic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Followup of #28318, #34038, and #34806 to simplify and optimize the logging-disabled path for
LogTrace().Removes the global log level (
m_log_level) and the unordered_map from category to level (m_category_log_levels) in favour of a singleatomic<uint64_t> m_trace_categories, and reducesShouldDebugLogandShouldTraceLogto lock-free checks on a single atomic. Also makesEnabled()lock-free, to waste a little less time in the case where debugging is completely disabled.Does a bit of clean up as well:
m_file_pathand provides accessorsThe following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
[[noreturn]]by fanquake)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
I first mentioned this three years ago at https://github.com/bitcoin/bitcoin/pull/25203#issuecomment-1401126785 and had originally included it in https://github.com/bitcoin/bitcoin/pull/28318#issuecomment-1701211340 . This branch was also linked to in https://github.com/bitcoin/bitcoin/pull/34038#discussion_r2735011334 Obviously conflicts with #35322.
🐙 This pull request conflicts with the target branch and needs rebase.
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
2 additional verified findings in the full report.
🟠 Minor · Enabling walletdb tracing with the new RPC argument does not trace wallets that are already open
The RPC reports walletdb as traced, but wallets that were already loaded produce no SQL trace output until they are reloaded.
Location:
src/rpc/node.cpp:282(head).🟠 Minor · MakeNoLogFileContext leaves debug and trace logging on for all categories
Fuzz targets and benchmarks built on it now format and discard every debug/trace message and run debug-only bookkeeping that base skipped.
Location:
src/test/util/setup_common.cpp:167(head).🟠 Minor · Kernel log masks can be left stale when SetMinLevel races with connection create/destroy
A libbitcoinkernel client calling these from different threads can lose Debug/Trace entries for an active subscriber until the next configuration change.
Location:
src/kernel/bitcoinkernel.cpp:548(head).🟠 Minor · Concurrent logging RPC updates can leave a category traced but not debug-logged
Overlapping updates to the same category can leave it reported as trace while its debug messages are dropped, until it is reconfigured.
Location:
src/logging.cpp:565(head).🔵 Suggestion ·
logginginclude/debug now removes trace logging from categories that were at traceCallers that list an already-traced category to enable debug logging silently lose its trace output, and neither the help text nor the release note says so.
Location:
src/rpc/node.cpp:279(head).🔵 Suggestion · Release note says wallet SQL is the only supported trace logging
cmpctblock and ipc also emit trace logs, so the note understates what -trace turns on.
Location:
doc/release-notes-34038.md:4(head).Reviewed:
36586ec1b397· Full review report · Previous reports