Go to file
Thomas Lamprecht b4b39b55f8 api: ceph osd: factor out getting PSS stat & improve error handling
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>
2023-09-04 14:44:33 +02:00
aplinfo website: update external links to www.proxmox.com 2023-08-23 10:09:25 +02:00
bin handle pve-kernel -> proxmox-kernel rename 2023-08-01 10:33:12 +02:00
configs pve sources: update dist to bookworm 2023-05-30 15:15:06 +02:00
debian bump version to 8.0.5 2023-08-16 12:12:47 +02:00
network-hooks makefile: convert to use simple parenthesis 2023-05-29 18:24:00 +02:00
PVE api: ceph osd: factor out getting PSS stat & improve error handling 2023-09-04 14:44:33 +02:00
services makefile: convert to use simple parenthesis 2023-05-29 18:24:00 +02:00
test fix mocking in notification tests 2023-08-16 11:58:22 +02:00
www api: ceph: improve reporting of ceph OSD memory usage 2023-09-04 13:53:35 +02:00
.gitignore Extend the .gitignore(s) 2018-05-04 14:50:04 +02:00
defines.mk fix #844: allow to pre-delay start-all-marked guests on boot 2019-11-20 20:20:58 +01:00
Makefile buildsys: ordering/style cleanups 2023-07-03 13:17:18 +02:00
spice-example-sh doc: spice-example-sh: support special characters in passwords 2017-10-05 13:57:27 +02:00
vzdump-hook-script.pl close #3476: vzdump: add job-init hook 2022-01-18 12:20:26 +01:00