Repository navigation
tentacle: mgr: forward the root-logger fallback at the record's own level - #70960
Merged
Merged
Conversation
MgrRootHandler captures third-party logs from the Python root logger and emits them through the _ceph_log method of whichever mgr module last configured logging. A handler on the root logger outlives any single module, so once that module unloads the handler emits through a stale pointer until another module reconfigures logging. Add a free mgr_log() function to the ceph_module binding, emitting via dout() like PyModuleRunner::log but with no PyModule involved, and rewrite MgrRootHandler to route through it. The handler no longer references a module instance, so it cannot go stale. Signed-off-by: Kefu Chai <[email protected]> (cherry picked from commit 3705db8)
ceph_module.mgr_log() emitted every record at dout(0): a record either passed the Python-side gate and went unconditionally to both the log file and the in-memory recent buffer, or never reached the C++ log at all. The two-level debug_mgr semantics (file level / memory level) never applied, so capturing third-party DEBUG logs meant sending each record to the log file and a log_max_recent slot; with the kubernetes client logging multi-megabyte HTTP response bodies at DEBUG, the recent buffer alone could grow to tens of gigabytes. Pass the record's level through mgr_log() and emit at the mapped ceph level: CRITICAL/ERROR at 0, WARNING at 1, INFO at 2, DEBUG at 20. INFO maps to 2 so it stays visible in the log file at the default debug_mgr=2/5; DEBUG maps to 20 so floods are dropped there, while debug_mgr=2/20 captures third-party DEBUG in the in-memory buffer without touching the log file. The Python-side gate follows the higher of the two debug_mgr levels so memory-only records still reach the C++ side. Fixes: https://tracker.ceph.com/issues/77633 Signed-off-by: Kefu Chai <[email protected]> (cherry picked from commit e61de15)
mheler
approved these changes
Aug 11, 2026
Contributor
|
This PR has been added to wip-yuri14-testing-20260812.153525-tentacle. |
Contributor
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.
backport tracker: https://tracker.ceph.com/issues/78591
backport of #70146
parent tracker: https://tracker.ceph.com/issues/77633
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh