From bd0244ffe63b752649ae74f65a46563e986dcb00 Mon Sep 17 00:00:00 2001 From: ZhiQiang Fan Date: Mon, 3 Nov 2014 20:57:04 +0800 Subject: 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 --- ceilometer/image/glance.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ceilometer/image') 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) -- cgit v1.2.1