]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr: ceph osd status crash with ZeroDivisionError 46697/head
authorNitzan Mordechai <nmordech@redhat.com>
Mon, 24 Jan 2022 10:55:23 +0000 (12:55 +0200)
committerNitzan Mordechai <nmordech@redhat.com>
Wed, 15 Jun 2022 11:43:14 +0000 (14:43 +0300)
commit40e0632ed58949790599493990ab6dba9549fafc
tree5a03d8b9e96aafb801d3eaf040f82d1c86f54a57
parent3a850220b7e147a086eeba4262cc2f39d89fe83c
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