]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr: generate crash dump for python exceptions
authorSage Weil <sage@newdream.net>
Fri, 18 Jun 2021 21:02:40 +0000 (17:02 -0400)
committerSage Weil <sage@newdream.net>
Wed, 23 Jun 2021 17:00:49 +0000 (13:00 -0400)
commit719d5e1836c95bcbc446dbeb7d8f03adefd02a3e
treeed562f90ea8fe9201a4d3cdd0fca682e6985ddd2
parent5878cbd768e0988a88adc84db81119873c17c36b
mgr: generate crash dump for python exceptions

Extend handle_pyerror() to generate a crash dump.  Pass some additional
context through from the callers (including the ability to not generate
a crash dump in the CLI handler case).

Extra crash dump fields look like so:

    "backtrace": [
        "  File \"/home/sage/src/ceph/src/pybind/mgr/balancer/module.py\", line 652, in serve\n    self.ifail()",
        "  File \"/home/sage/src/ceph/src/pybind/mgr/balancer/module.py\", line 648, in ifail\n    raise RuntimeError('test')",
    ],
    "mgr_module": "balancer",
    "mgr_module_caller": "PyModuleRunner::serve",
    "mgr_python_exception": "RuntimeError",

Notably, the backtrace deliberately excludes the 'value' of the exception,
as that may leak identifying information about the system.  Instead, we
only include the exception *type* and the portion of the traceback that
identifies the call path (where in the code we crashed).

Also note: a side-effect of this change is that module exceptions will
trigger cluster health warnings about daemon crashes.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mgr/ActivePyModule.cc
src/mgr/ActivePyModule.h
src/mgr/ActivePyModules.cc
src/mgr/PyModule.cc
src/mgr/PyModule.h
src/mgr/PyModuleRunner.cc
src/mgr/StandbyPyModules.cc