mgr: generate crash dumps for Python exceptions in mgr modules#41937
Merged
tchaikov merged 8 commits intoceph:masterfrom Jun 26, 2021
Merged
mgr: generate crash dumps for Python exceptions in mgr modules#41937tchaikov merged 8 commits intoceph:masterfrom
tchaikov merged 8 commits intoceph:masterfrom
Conversation
tchaikov
reviewed
Jun 19, 2021
tchaikov
approved these changes
Jun 23, 2021
Signed-off-by: Sage Weil <sage@newdream.net>
This may seem a bit backwards: we take nice C++ list<string> and do the C dance. It's a bit defensive: this class is used in the segv handler (in the backtrace() and backtrace_symbol() path), so we want to minimize the work we do on the heap in that case. (For the list<string> path, we can do whatever we like.) Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
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>
Generate a different warning for crashes in mgr module python code, as they do not mean that the entire mgr daemon crashed. Document. Signed-off-by: Sage Weil <sage@newdream.net>
Broken by 8c009e2 Signed-off-by: Sage Weil <sage@newdream.net>
Include the exception value in teh crash dump, but redact it in telemetry. That way the operator can see it (it's useful info!) but we don't risk sharing identifying data via telemetry. Signed-off-by: Sage Weil <sage@newdream.net>
Member
Author
|
jenkins test make check |
tchaikov
approved these changes
Jun 25, 2021
Contributor
tchaikov
requested changes
Jun 25, 2021
Contributor
tchaikov
left a comment
There was a problem hiding this comment.
- https://pulpito.ceph.com/kchai-2021-06-24_01:47:39-rados-wip-kefu-testing-2021-06-23-2306-distro-basic-smithi/
- https://pulpito.ceph.com/kchai-2021-06-24_12:12:02-rados-wip-kefu-testing-2021-06-23-2306-distro-basic-smithi/
- https://pulpito.ceph.com/kchai-2021-06-25_02:55:38-rados-wip-kefu-testing-2021-06-23-2306-distro-basic-smithi/
- https://pulpito.ceph.com/kchai-2021-06-25_14:06:41-rados-wip-kefu-testing-2021-06-25-1703-distro-basic-smithi/
might want to address this one before merging this changeset
Member
Author
First two are addressed by #41946 Last one is a self-test, will add to ignorelist |
One of the selftests triggers an exception from serve(). Signed-off-by: Sage Weil <sage@newdream.net>
Contributor
tchaikov
approved these changes
Jun 26, 2021
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
They look like so:
Notably, we exclude the 'value' portion of the exception when reporting telemetry, as that may contain identifying information.