]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
DNM: mgr command debugging
authorSamuel Just <sjust@redhat.com>
Sat, 8 Nov 2025 01:48:17 +0000 (01:48 +0000)
committerSamuel Just <sjust@redhat.com>
Wed, 17 Dec 2025 17:41:53 +0000 (17:41 +0000)
src/mgr/ActivePyModule.cc
src/pybind/mgr/mgr_module.py

index 6df0e1aefa5e167b2e99c0ad99d98d8d81739471..f023e11da025eb821c28c0a9f24da335855ef395 100644 (file)
@@ -210,6 +210,9 @@ int ActivePyModule::handle_command(
 
   Gil gil(py_module->pMyThreadState, true);
 
+  dout(10) << "ActivePyModule::handle_command dispatching command '"
+           << cmdmap << dendl;
+
   PyFormatter f;
   TOPNSPC::common::cmdmap_dump(cmdmap, &f);
   PyObject *py_cmd = f.get();
@@ -220,9 +223,13 @@ int ActivePyModule::handle_command(
   m_command_perms = module_command.perm;
   m_session = &session;
 
+  dout(10) << "ActivePyModule::handle_command calling into interpreter for '"
+           << cmdmap << dendl;
   auto pResult = PyObject_CallMethod(pClassInstance,
       const_cast<char*>("_handle_command"), const_cast<char*>("s#O"),
       instr.c_str(), instr.length(), py_cmd);
+  dout(10) << "ActivePyModule::handle_command call into interpreter complete for '"
+           << cmdmap << dendl;
 
   m_command_perms.clear();
   m_session = nullptr;
index aca229dc1a389f676198f1cf9c20f6fc46a561b8..120f40f39f0e5e23bb7ed445b0d98c6d3fe089f5 100644 (file)
@@ -1969,10 +1969,16 @@ class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin):
                         inbuf: str,
                         cmd: Dict[str, Any]) -> Union[HandleCommandResult,
                                                       Tuple[int, str, str]]:
+        inbuflen = str(len(inbuf)) if inbuf is not None else "None"
+        self.log.debug(f"_handle_command len(inbuf) {inbuflen} cmd {cmd}")
         if cmd['prefix'] not in self.CLICommand.COMMANDS:  # type: ignore[attr-defined]
-            return self.handle_command(inbuf, cmd)
+            ret = self.handle_command(inbuf, cmd)
+            self.log.debug(f"_handle_command len(inbuf) {inbuflen} cmd {cmd} ret {ret}")
+            return ret
 
-        return self.CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf)  # type: ignore[attr-defined]
+        ret = self.CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf)  # type: ignore[attr-defined]
+        self.log.debug(f"_handle_command len(inbuf) {inbuflen} cmd {cmd} ret {ret}")
+        return ret
 
     def handle_command(self,
                        inbuf: str,