diff options
author | ZhiQiang Fan <zhiqiang.fan@huawei.com> | 2014-11-03 20:57:04 +0800 |
---|---|---|
committer | ZhiQiang Fan <aji.zqfan@gmail.com> | 2014-11-20 03:00:22 +0800 |
commit | bd0244ffe63b752649ae74f65a46563e986dcb00 (patch) | |
tree | c761fcd12297a45fd5ecfbc8950771aac62e597e /ceilometer/image | |
parent | 2117ba760cffd03bf4ce14d63f30fe53f2b363bd (diff) | |
download | ceilometer-bd0244ffe63b752649ae74f65a46563e986dcb00.tar.gz |
Add timeout to all http requests
Currently, we generate lots of samples by polling data from other services,
but theses rest requests have no timeout limitation. We have observed that
some requests (for example, keystone due to openssl problem) may stuck for
over several days (maybe forever if we don't restart the service). Other
pollsters in same thread will not be able to work too. The worst thing is
that, when outside (keystone) service becomes normal, Ceilometer cannot
recover itself automatically, cloud operator needs to restart it manually.
So I strongly suggest that we should add timeout limit to **every** rest api
call, this is quite important to improve Ceilometer's robust and reliability.
This patch adds a new option named http_timeout, and applies it to almost
all http requests in Ceilometer project.
Change-Id: I76df2c0a9ffacb252e15edbb125e37ccb2aac4aa
Closes-Bug: #1388778
Diffstat (limited to 'ceilometer/image')
-rw-r--r-- | ceilometer/image/glance.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ceilometer/image/glance.py b/ceilometer/image/glance.py index 76292e77..6225d216 100644 --- a/ceilometer/image/glance.py +++ b/ceilometer/image/glance.py @@ -62,7 +62,8 @@ class _Base(plugin.CentralPollster): return glanceclient.Client('1', endpoint, token=ksclient.auth_token, cacert=service_credentials.os_cacert, - insecure=service_credentials.insecure) + insecure=service_credentials.insecure, + timeout=cfg.CONF.http_timeout) def _get_images(self, ksclient, endpoint): client = self.get_glance_client(ksclient, endpoint) |