Repository navigation
mgr: guard close_section calls in get_perf_schema_python - #68213
Conversation
When a daemon exists in the daemon state map but has no perf counters (e.g. an OSD that was running but is now down or destroyed), the loop in get_perf_schema_python never executes, leaving prev_key_name empty and no formatter sections opened. The unconditional close_section() calls after the loop then trigger an assertion failure in PyFormatter (cursor != root). Add the same `if (!prev_key_name.empty())` guard that already protects the close_section() calls inside the loop, so we only close sections that were actually opened. Fixes: https://tracker.ceph.com/issues/75745 Signed-off-by: Lumir Sliva <[email protected]>
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
14 similar comments
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
ok to test |
|
jenkins test make check |
|
jenkins test make check arm6 |
|
jenkins test make check arm64 |
|
jenkins test dashboard cephadm |
|
jenkins test rook e2e |
|
jenkins test dashboard |
Problem
get_perf_schema_pythoninActivePyModules.cccrashes with an assertionfailure when iterating daemons that have no perf counters. This happens when
a daemon (e.g. an OSD) was running and registered in the daemon state map,
but is now down or destroyed — its
perf_counters.instancesmap is empty.The function unconditionally calls
f.close_section()twice after the perfcounter loop to close the
countersandcounter objectsections. When theloop never executes (empty instances), no sections were opened, and the close
calls trigger
FAILED ceph_assert(cursor != root)inPyFormatter.h:85.This was introduced in PR #66824 (perf schema labels rewrite, merged 2026-03-30).
Fix
Add the same
if (!prev_key_name.empty())guard that already protects theclose_section()calls inside the loop (line 1243), so we only closesections that were actually opened.
Reproduction
On a vstart dev cluster, stop an OSD so it remains in the daemon state map
with empty perf counters, then call
get_perf_schema("osd", "")via theselftest module:
Before fix — mgr asserts:
After fix — succeeds:
Tracker: https://tracker.ceph.com/issues/75745
Checklist