From d3ee8ef00a6c61cb0326d06fd277ceb5f1bdf0c5 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Thu, 16 Sep 2021 10:14:34 -0700 Subject: [PATCH] Fix BackOffLoopingCall error so it is not misleading The backoff looping call logging was previously making a decision on if timeout had or was going to be exceeded by including idle time and it's internal time, however this is misleading as the overall operation may take 30 seconds externally, a user initiated timeout of 30 seconds is requested, and the error might say something like 18 seconds has passed, when that is incorrect. The logic is actualy correct, the logging was just misleading. Fixes the exception message to use the total time. Change-Id: Ie9ef5a53abb24f6ab7de0ad57a672c0a8d7ff0ee --- oslo_service/loopingcall.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_service/loopingcall.py b/oslo_service/loopingcall.py index 32c7573a..794f0cfd 100644 --- a/oslo_service/loopingcall.py +++ b/oslo_service/loopingcall.py @@ -348,7 +348,7 @@ class BackOffLoopingCall(LoopingCallBase): if timeout > 0 and self._error_time + idle > timeout: raise LoopingCallTimeOut( _('Looping call timed out after %.02f seconds') - % self._error_time) + % (self._error_time + idle)) self._error_time += idle return idle