]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr: guard close_section calls in get_perf_schema_python 69436/head
authorLumir Sliva <61183145+lumir-sliva@users.noreply.github.com>
Sat, 4 Apr 2026 15:25:15 +0000 (17:25 +0200)
committerPatrick Donnelly <pdonnell@ibm.com>
Fri, 12 Jun 2026 13:29:43 +0000 (09:29 -0400)
commit38a563810c493bbccff1f28db716724c9b8a6cc9
treeb458b48e83426333f1d59f2338f606c8f529f4b5
parent602efe1b0e01d593902b204ac682f5b5b99b2453
mgr: guard close_section calls in get_perf_schema_python

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 <61183145+lumir-sliva@users.noreply.github.com>
(cherry picked from commit b1c1ddaf0b771420e0905cd47e33919de5e11fd5)
src/mgr/ActivePyModules.cc