core: add prevention for negative update_due and log it as warning
@@ -405,7 +405,14 @@ class Py3statusWrapper:
# we return how long till we next need to process the timeout_queue
# this value should not be negative to avoid cpu overwhelming loops
if self.timeout_due is not None:
- return max(0, self.timeout_due - time.monotonic())
+ new_update_due = self.timeout_due - time.monotonic()
+ if new_update_due < 0:
+ self.log(
+ f"prevented negative update time ({new_update_due})",
+ level="warning",
+ )
+ else:
+ return new_update_due
def gevent_monkey_patch_report(self):
"""
