Loopingcalls doesn't blow when function executed more than timeout value
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.service |
Confirmed
|
Medium
|
Unassigned |
Bug Description
When function is executed more time than timeout value, loopingcall will not blow,
the following example shows it:
>>> from oslo_service import loopingcall
>>> import time
>>> def function(sleep):
... time.sleep(sleep)
... raise loopingcall.
...
>>> time.ctime(); timer = loopingcall.
'Tue Nov 7 11:12:53 2017'
'Tue Nov 7 11:12:56 2017'
>>> time.ctime(); timer = loopingcall.
'Tue Nov 7 11:12:57 2017'
'Tue Nov 7 11:13:07 2017'
>>>
By default requests doesn't have timeout value and may hung forever http://
Related Bug was opened in ironic-python-agent project https:/
I think the intent behind the loopingcall classes was that the timeout applied to repeated calls to the function in question, not that it would prevent the function from running longer than the timeout. However, the docstring does seem to indicate that both are valid, which needs to be addressed by either setting a timeout on the function call or clarifying the docstring so that there is no confusion about what the timeout applies to.