Skip to content

tentacle: mgr: add config to load modules in main interpreter instead of subinterpreter - #67515

Merged
batrick merged 12 commits into
ceph:tentaclefrom
NitzanMordhai:wip-66244-tentacle
May 8, 2026
Merged

batrick merged 12 commits into
ceph:tentaclefrom
NitzanMordhai:wip-66244-tentacle

Conversation

@NitzanMordhai

@NitzanMordhai NitzanMordhai commented Feb 25, 2026 •

Copy link
Copy Markdown
Contributor

Backports: #66244
Includes also #67954 and #67588 (backport of #67327)

Fixes: https://tracker.ceph.com/issues/75644
Fixes: https://tracker.ceph.com/issues/75645
Fixes: https://tracker.ceph.com/issues/76382

  • mgr: serialize python objects sent between subinterpreters via remote
  • python-common/.../service_spec: implement ServiceSpec.getnewargs to allow unpickle to work correctly
  • mgr: add mgr_subinterpreter_modules config
  • mgr/Gil.cc: do not use PyGILState_Check()
  • mgr/Gil.cc: simplify Gil(), ~Gil()

@github-actions

Copy link
Copy Markdown

Config Diff Tool Output

+ added: mgr_subinterpreter_modules (mgr.yaml.in)

The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment /config check ok and re-run the test.

@yaarith

yaarith commented May 8, 2026

Copy link
Copy Markdown
Contributor

jenkins test dashboard

@yaarith

yaarith commented May 8, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check

@yaarith

yaarith commented May 8, 2026

Copy link
Copy Markdown
Contributor

jenkins test api

@yaarith

yaarith commented May 8, 2026

Copy link
Copy Markdown
Contributor

jenkins test dashboard cephadm

@batrick batrick 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.

Automated Backport Parity Review - Unmerged Commits Detected

This backport contains cherry-picks of commits that do not appear to be merged into the main branch (could not find an associated merge commit or PR). Backports should only contain commits that have already been merged upstream.

Unmerged Cherry-Picks

  • Backport commit 9393357b cherry-picks 3e710f7a
  • Backport commit cea94615 cherry-picks ac02bbbe

Be familiar with the rules and guidelines for writing backports.


Automated Backport Parity Review

⚠️ Multiple Original PRs Detected: PR #66244, PR #67327, PR #67954

Discrepancies detected between the backport PR and the original source PR(s). Please see the Commit Parity Visualizer below.


Automated Backport Parity Review - Backport Deviation Alert

A conflict or unapproved deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.

How to proceed:

  • Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git Conflicts: block intact) and include an explanation for changes.
  • Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
  • Component Leads (Review): Please review the Range Diff below to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting /audit override.

Be familiar with the rules and guidelines for writing backports.

Affected File(s)

Range Diff

Click to expand
--- Original (f69069e1)
+++ Backport (a56b25cb)
@@ -1,3 +1,8 @@
 mgr: serialize python objects sent between subinterpreters via remote
 
 Signed-off-by: Samuel Just <[email protected]>
+(cherry picked from commit f69069e114ea8c785d6c27c57560a0b9bb8c16be)
+
+Conflicts:
+  - src/mgr/PyModule.cc
+	Missing commit 3366ef5 still didn't merge, just take the changes for the dtor

================================================================================
RANGE DIFF
================================================================================

1:  f69069e114e ! 1:  a56b25cb788 mgr: serialize python objects sent between subinterpreters via remote
    @@ Commit message
         mgr: serialize python objects sent between subinterpreters via remote
     
         Signed-off-by: Samuel Just <[email protected]>
    +    (cherry picked from commit f69069e114ea8c785d6c27c57560a0b9bb8c16be)
    +
    +    Conflicts:
    +      - src/mgr/PyModule.cc
    +            Missing commit 3366ef5 still didn't merge, just take the changes for the dtor
     
      ## src/mgr/ActivePyModule.cc ##
     @@ src/mgr/ActivePyModule.cc: bool ActivePyModule::method_exists(const std::string &method) const
    @@ src/mgr/PyModule.cc: PyModule::~PyModule()
          Py_XDECREF(pClass);
          Py_XDECREF(pStandbyClass);
     +    Py_XDECREF(pPickleModule);
    -     Py_EndInterpreter(pMyThreadState.ts);
    -     pMyThreadState.ts = nullptr;
        }
    + }
    + 
     
      ## src/mgr/PyModule.h ##
     @@ src/mgr/PyModule.h: std::string handle_pyerror(bool generate_crash_dump = false,

Automated Redmine Linkage Audit

The following tracking irregularities were found:

  • Mismatched PR Link: Backport tracker #75641 points to PR #67588, not this backport PR #67515.
  • Missing PR Link: Backport tracker #76381 has no 'Pull Request ID' field set. Please link it to PR #67515.
  • Orphaned Main PR: Could not find a Redmine tracker for main PR #67954. Please create a ticket, set its 'Pull Request ID', populate the 'Backports' field, and ensure it is in the 'Pending Backport' state.

Commit Parity Visualizer

BACKPORT PR #67515 SOURCE PR SOURCE STATUS
a56b25cb788102c1337781df04d9bc59a0a1c75c mgr: serialize python objects sent between subinterpreters via remote PR #66244 f69069e mgr: serialize python objects sent between subinterpreters via remote
63aff190f5104d10dda08be2bd95633f7688a288 python-common/.../service_spec: implement ServiceSpec.getnewargs to allow unpickle to work correctly d4a1f2b python-common/.../service_spec: implement ServiceSpec.getnewargs to allow unpickle to work correctly
bdea5f526c7a6663e8e8f7666d391fda6b77ed0a mgr: add mgr_subinterpreter_modules config 239b0dc mgr: add mgr_subinterpreter_modules config
d8574fecd5f9cacafe1f35a82a1ad31b17dba203 mgr/Gil.cc: do not use PyGILState_Check() 19a9981 mgr/Gil.cc: do not use PyGILState_Check()
996b88cd971395031a1925122161a120e4a2c919 mgr/Gil.cc: simplify Gil(), ~Gil() fb26bcd mgr/Gil.cc: simplify Gil(), ~Gil()
9393357b66d9f23b1c928074d76eb417dc1b0f77 pybind/mgr/mgr_module: isolate logging per mgr module <<<< EXTRA IN BACKPORT >>>>
cea9461563a47257cbcf4172d8489c0ee6104d6b selftest: Add logging self tests <<<< EXTRA IN BACKPORT >>>>
b9cbc7e1f4c780bf2535d0ec3820bfcce202dab7 mgr/dashboard: use name for module-specific logging PR #67327 8c0f0d5 mgr/dashboard: use name for module-specific logging
<<<< MISSING IN BACKPORT >>>> a89e176 pybind/mgr/mgr_module: isolate logging per mgr module
<<<< MISSING IN BACKPORT >>>> 9369434 selftest: Add logging self tests
d03f6ebc9a71faa5c40736b91e945c85ada2ba89 mgr/selftest: mypy error fix missing a type annotation PR #67954 3bfe66a mgr/selftest: mypy error fix missing a type annotation
0d4982af90b92f980ea6cb70b1232cf75ff59d8a mgr/mgr_module: fix tox test missing a type annotation e282619 mgr/mgr_module: fix tox test missing a type annotation
7a8ad080edf9aa16af33a1af211a5ef57b321c1d orchestrator/test/test_orchestrator: fix return code to negative dede880 orchestrator/test/test_orchestrator: fix return code to negative

🛟 Need Help?

If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.

📋 Component Lead / Release Manager

To override the audit failure, apply releng-audit-override label or comment /audit override.

@batrick batrick added the releng-audit-fail Release engineering: failed backport verification audit. label May 8, 2026
@github-project-automation github-project-automation Bot moved this from New to Review in progress in Ceph-Dashboard May 8, 2026
athanatos and others added 11 commits May 8, 2026 15:38
Signed-off-by: Samuel Just <[email protected]>
(cherry picked from commit f69069e)

Conflicts:
  - src/mgr/PyModule.cc
	Missing commit 3366ef5 still didn't merge, just take the changes for the dtor
…to allow unpickle to work correctly

Signed-off-by: Samuel Just <[email protected]>
(cherry picked from commit d4a1f2b)
This commit adds a mgr_subinterpreter_modules config to cause specified
modules (or all if * is specified) to be loaded in individual
subinterpreters.

This changes the default behavior of ceph-mgr from running each module
in a distinct subinterpreter to running them all in the same main
interpreter.  We can reintroduce subinterpreter support over time by
adding modules to the list as we test them.

Fixes: https://tracker.ceph.com/issues/73857
Fixes: https://tracker.ceph.com/issues/73859
Signed-off-by: Samuel Just <[email protected]>
(cherry picked from commit 239b0dc)

Conflicts:
  - src/mgr/PyModule.cc
     #include "common/JSONFormatter.h" - removed (missing commit 3ab70dd in tentacle), not in tentacle
     dtor - still missing commit 3366ef5 on tentacle causing conflicts,
      taking tentacle changes with use_main_interpreter and end the interpater pMyThreadState.ts
Instead of restoring the passed ts and then swapping to
a fresh one, restore the fresh one in the first place.

Signed-off-by: Samuel Just <[email protected]>
(cherry picked from commit fb26bcd)
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 a89e176)
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)
After changes of PR ceph#67327

Signed-off-by: Nitzan Mordechai <[email protected]>
(cherry picked from commit 3bfe66a)
After changes of PR ceph#67327

Signed-off-by: Nitzan Mordechai <[email protected]>
(cherry picked from commit e282619)
After changes of PR ceph#67652

Signed-off-by: Nitzan Mordechai <[email protected]>
(cherry picked from commit dede880)
@batrick
batrick force-pushed the wip-66244-tentacle branch from 7a8ad08 to baafb66 Compare May 8, 2026 19:45
batrick
batrick previously requested changes May 8, 2026

@batrick batrick 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.

Automated Backport Parity Review - Multiple PRs Detected

This backport appears to pull commits from multiple main PRs including: PR #66244, PR #67327, PR #67954.

This must be made explicit in the backport PR description. Furthermore, each backport tracker ticket associated with these main PRs must be linked to this PR.


Automated Redmine Linkage Audit

The following tracking irregularities were found:

  • Mismatched PR Link: Backport tracker #75641 points to PR #67588, not this backport PR #67515.
  • Orphaned Main PR: Could not find a Redmine tracker for main PR #67954. Please create a ticket, set its 'Pull Request ID', populate the 'Backports' field, and ensure it is in the 'Pending Backport' state.
  • Missing PR Link: Backport tracker #76381 has no 'Pull Request ID' field set. Please link it to PR #67515.

Commit Parity Visualizer

BACKPORT PR #67515 SOURCE PR SOURCE STATUS
cd5f7a1 mgr: serialize python objects sent between subinterpreters via remote PR #66244 f69069e mgr: serialize python objects sent between subinterpreters via remote
00914e0 python-common/.../service_spec: implement ServiceSpec.getnewargs to allow unpickle to work correctly d4a1f2b python-common/.../service_spec: implement ServiceSpec.getnewargs to allow unpickle to work correctly
cf0c474 mgr: add mgr_subinterpreter_modules config 239b0dc mgr: add mgr_subinterpreter_modules config
b903133 mgr/Gil.cc: do not use PyGILState_Check() 19a9981 mgr/Gil.cc: do not use PyGILState_Check()
33eaf2f mgr/Gil.cc: simplify Gil(), ~Gil() fb26bcd mgr/Gil.cc: simplify Gil(), ~Gil()
0531a9f pybind/mgr/mgr_module: isolate logging per mgr module PR #67327 a89e176 pybind/mgr/mgr_module: isolate logging per mgr module
2fb437b selftest: Add logging self tests 9369434 selftest: Add logging self tests
df67569 mgr/dashboard: use name for module-specific logging 8c0f0d5 mgr/dashboard: use name for module-specific logging
f475141 mgr/selftest: mypy error fix missing a type annotation PR #67954 3bfe66a mgr/selftest: mypy error fix missing a type annotation
4b9e31d mgr/mgr_module: fix tox test missing a type annotation e282619 mgr/mgr_module: fix tox test missing a type annotation
baafb66 orchestrator/test/test_orchestrator: fix return code to negative dede880 orchestrator/test/test_orchestrator: fix return code to negative

🛟 Need Help?

If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.

📋 Component Lead / Release Manager

To override the audit failure, apply releng-audit-override label or comment /audit override.

OrchestratorError stores errno as abs(), so e.errno is always positive.
Returning retval=e.errno (+22) caused the ceph CLI to exit 0 since it
only propagates the exit code when ret < 0.

Fix by returning retval=-e.errno.

Fixes: https://tracker.ceph.com/issues/75282
Signed-off-by: Nitzan Mordhai <[email protected]>
(cherry picked from commit 18546fa)

@batrick batrick 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.

Automated Backport Parity Review - Multiple PRs Detected

This backport appears to pull commits from multiple main PRs including: PR #66244, PR #67327, PR #67652, PR #67954.

This must be made explicit in the backport PR description. Furthermore, each backport tracker ticket associated with these main PRs must be linked to this PR.


Automated Redmine Linkage Audit

The following tracking irregularities were found:

  • Orphaned Main PR: Could not find a Redmine tracker for main PR #67954. Please create a ticket, set its 'Pull Request ID', populate the 'Backports' field, and ensure it is in the 'Pending Backport' state.

Commit Parity Visualizer

BACKPORT PR #67515 SOURCE PR SOURCE STATUS
cd5f7a1 mgr: serialize python objects sent between subinterpreters via remote PR #66244 f69069e mgr: serialize python objects sent between subinterpreters via remote
00914e0 python-common/.../service_spec: implement ServiceSpec.getnewargs to allow unpickle to work correctly d4a1f2b python-common/.../service_spec: implement ServiceSpec.getnewargs to allow unpickle to work correctly
cf0c474 mgr: add mgr_subinterpreter_modules config 239b0dc mgr: add mgr_subinterpreter_modules config
b903133 mgr/Gil.cc: do not use PyGILState_Check() 19a9981 mgr/Gil.cc: do not use PyGILState_Check()
33eaf2f mgr/Gil.cc: simplify Gil(), ~Gil() fb26bcd mgr/Gil.cc: simplify Gil(), ~Gil()
0531a9f pybind/mgr/mgr_module: isolate logging per mgr module PR #67327 a89e176 pybind/mgr/mgr_module: isolate logging per mgr module
2fb437b selftest: Add logging self tests 9369434 selftest: Add logging self tests
df67569 mgr/dashboard: use name for module-specific logging 8c0f0d5 mgr/dashboard: use name for module-specific logging
f475141 mgr/selftest: mypy error fix missing a type annotation PR #67954 3bfe66a mgr/selftest: mypy error fix missing a type annotation
4b9e31d mgr/mgr_module: fix tox test missing a type annotation e282619 mgr/mgr_module: fix tox test missing a type annotation
baafb66 orchestrator/test/test_orchestrator: fix return code to negative dede880 orchestrator/test/test_orchestrator: fix return code to negative
6f067d0 pybind/orchestrator/cli: fix OrchestratorError retval sign PR #67652 18546fa pybind/orchestrator/cli: fix OrchestratorError retval sign

🛟 Need Help?

If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.

📋 Component Lead / Release Manager

To override the audit failure, apply releng-audit-override label or comment /audit override.

@batrick
batrick dismissed their stale review May 8, 2026 19:55

addressed

@github-project-automation github-project-automation Bot moved this from Review in progress to Reviewer approved in Ceph-Dashboard May 8, 2026
@batrick
batrick merged commit 9b17f16 into ceph:tentacle May 8, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ceph-Dashboard May 8, 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.

4 participants