]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Make sure report_interval is less than service_down_time
authorZhiteng Huang <zhithuang@ebaysf.com>
Thu, 9 Jan 2014 06:54:22 +0000 (14:54 +0800)
committerZhiteng Huang <zhithuang@ebaysf.com>
Mon, 27 Jan 2014 07:30:30 +0000 (15:30 +0800)
commit80096b6fb62cec4056efd1aba070623a789571dc
tree38b66c706a93abdc38ed42674ff5d99643a9d600
parentcbc6e8ef5da434d0158b1cb8545c5182c5b96cdf
Make sure report_interval is less than service_down_time

Services that inherit service.py/Service class would register
themselves to DB and then update stats periodically (every
report_interval second).  The consumer of this kind of information,
like scheduler or 'os-service' API extension, will consider a service
is 'up' (active) if last update from that service is not longer than
'service_down_time' ago.

The problem is if 'report_interval' was configured/provided greater
than 'service_down_time' by mistake, services would then be always
considered in 'down' state, which can result in unsuccesful placement
of volume create request for example.  This is what Bug #1255685 is
about.

In previous fix: https://review.openstack.org/#/c/60760/, a
configuration check helper function basic_config_check() was added
*wrongly* to WSGIService class instead of Service class.  This patch
moves the configuration check helper function and the check to the
right place to make sure 'report_interval' is less then
'service_down_time'.

Closes-bug #1255685

Change-Id: I14bd8c54e5ce20719844f437808ad98a011820de
cinder/service.py
cinder/tests/test_service.py