]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr: ceph osd status crash with ZeroDivisionError 46696/head
authorNitzan Mordechai <nmordech@redhat.com>
Mon, 24 Jan 2022 10:55:23 +0000 (12:55 +0200)
committerNitzanMordhai <nmordech@redhat.com>
Sun, 19 Nov 2023 11:03:14 +0000 (11:03 +0000)
commit0c76bc4217bfd365d786a18acfe87ea8e0f85500
treeb7d0c1d0797f379a468513b3d276f541e4584529
parentc09802b65179143558f9436eb7a918d8ba8b9a7b
pybind/mgr: ceph osd status crash with ZeroDivisionError

If stats-update is called a second time within a second, get_rate() fails with
a 'divide by 0' error.
Change the check before the computation, taking into account the fact that
two f.p numbers may differ, but still their diff - when cast into an int - might
be zero.

Fixed: https://tracker.ceph.com/issues/53538
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
(cherry picked from commit 140b7ce529f23ae429e71dfc1ad0deef13174e88)
src/pybind/mgr/status/module.py