From: Samuel Just Date: Sat, 8 Nov 2025 01:48:17 +0000 (+0000) Subject: DNM: mgr command debugging X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1780b5401f259fe4b05f9e579aba0aca70e6f65c;p=ceph-ci.git DNM: mgr command debugging --- diff --git a/src/mgr/ActivePyModule.cc b/src/mgr/ActivePyModule.cc index 6df0e1aefa5..f023e11da02 100644 --- a/src/mgr/ActivePyModule.cc +++ b/src/mgr/ActivePyModule.cc @@ -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("_handle_command"), const_cast("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; diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index aca229dc1a3..120f40f39f0 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -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,