Skip to content

tentacle: pybind/mgr/mgr_module: isolate logging per mgr module - #67588

Closed
NitzanMordhai wants to merge 3 commits into
ceph:tentaclefrom
NitzanMordhai:wip-67327-tentacle
Closed

NitzanMordhai wants to merge 3 commits into
ceph:tentaclefrom
NitzanMordhai:wip-67327-tentacle

Conversation

@NitzanMordhai

@NitzanMordhai NitzanMordhai commented Mar 1, 2026 •

Copy link
Copy Markdown
Contributor

@batrick

batrick commented Apr 21, 2026

Copy link
Copy Markdown
Member

jenkins test docs

@batrick

batrick commented Apr 21, 2026

Copy link
Copy Markdown
Member

jenkins test make check

@batrick

batrick commented Apr 21, 2026

Copy link
Copy Markdown
Member

jenkins test api

After PR ceph#66244, all mgr modules run inside the same Python interpreter.
That means they also share the same logging subsystem.
Previously, each module attached its handlers to the root logger. In practice,
whichever module initialized logging last effectively “owned” the root logger,
and log messages from other modules could end up attributed incorrectly.

This change scopes logging per module. Each module now registers its handlers
on a dedicated logger named after the module itself, with propagate=False to avoid
leaking messages into the root logger.

Now, the getLogger() default (no args) returns the module's named logger
rather than the root logger. This ensures self.log routes correctly.

Fixes: https://tracker.ceph.com/issues/74848
Signed-off-by: Nitzan Mordechai <[email protected]>
(cherry picked from commit 3e710f7ade56a65143b86c6d5bc2710a6a5d2198)
Fixes: https://tracker.ceph.com/issues/74848
Signed-off-by: Nitzan Mordechai <[email protected]>
(cherry picked from commit ac02bbbed078cf0b7b2f19e79ff7deb2948f1f91)
Previously, using a hard-coded logger name like 'rgw_client' created
a top-level logger that bypassed the 'mgr.dashboard' hierarchy.
By switching to __name__, we ensure the logger identity follows the
package structure (e.g., 'mgr.dashboard.services.rgw_client').

Since propagate=True is enabled, this allows log records to flow
upward through the 'mgr' parent loggers, ensuring they are correctly
captured, formatted, and attributed to the dashboard module rather than
falling back to the root logger.

Fixes: https://tracker.ceph.com/issues/74848
Signed-off-by: Nitzan Mordechai <[email protected]>
(cherry picked from commit 8c0f0d5)
@batrick
batrick force-pushed the wip-67327-tentacle branch from 580dffa to 8021344 Compare April 21, 2026 19:37
@batrick

batrick commented Apr 21, 2026

Copy link
Copy Markdown
Member

(trivial rebase)

@batrick batrick modified the milestones: tentacle, v20.2.2 Apr 21, 2026
@batrick

batrick commented Apr 21, 2026

Copy link
Copy Markdown
Member

@batrick

batrick commented Apr 28, 2026

Copy link
Copy Markdown
Member

This PR has been identified as desirable for v20.2.2.

Please make sure this PR:

  • is rebased
  • passes CI tests
  • cross-references backport tracker tickets properly

When you believe it's ready for consideration, please add the https://github.com/ceph/ceph/labels/pdonnell-tentacle-RFA label to this PR.

@NitzanMordhai

Copy link
Copy Markdown
Contributor Author

@batrick batrick added the releng-audit-queue Release engineering: queued for backport verification audit. label Apr 30, 2026
@yaarith
yaarith marked this pull request as ready for review May 1, 2026 00:54
@yaarith
yaarith requested a review from a team as a code owner May 1, 2026 00:54
@yaarith
yaarith requested review from cloudbehl and nmunet May 1, 2026 00:54
@github-project-automation github-project-automation Bot moved this from New to Reviewer approved in Ceph-Dashboard May 1, 2026
@batrick

batrick commented May 2, 2026

Copy link
Copy Markdown
Member

@batrick batrick added releng-audit-pass Release engineering: passed backport verification audit. and removed releng-audit-queue Release engineering: queued for backport verification audit. labels May 2, 2026
@NitzanMordhai

Copy link
Copy Markdown
Contributor Author

Cherry-picked into #67515, this PR will be closed

@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ceph-Dashboard May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants