mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-16 06:13:39 +00:00
![]() Do not crowd the higher level API endpoint handler code directly with some rather low level procfs parsing code, rather factor that out in a helper. Make said helper private for now so that anybody wanting to use cannot do so, and thus increase the chance that said dev will actually think about if this makes sense as is as a general interface. Avoid fatal die's for the odd case that the smaps_rollup file cannot be opened, or the even less likely case where PSS stats cannot be found in the content. The former could happen due to the general TOCTOU race here, i.e., the PID we get from systemctl service status parsing isn't guaranteed to exist anymore when we read from procfs, and if, it's actually not guaranteed to still be the OSD - but we cannot easily use pidfd's here and OSD stops are not something that happens frequently, but in anyway avoid that such a thing fails the whole API call only because a single metric is affected. In the long rung it might be better to add a "errors" array to the response, so that the user can be informed about such an (odd) thing happening. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> |
||
---|---|---|
.. | ||
Cfg.pm | ||
FS.pm | ||
Makefile | ||
MDS.pm | ||
MGR.pm | ||
MON.pm | ||
OSD.pm | ||
Pool.pm |