From 10300af4f55b179f7aea909a8d752ed4ac4c2d70 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Thu, 6 Mar 2014 17:28:11 +0100 Subject: [PATCH] Enable monkeypatch for select module When we use ceilometer with kombu (rabbitmq), sometimes when the server is gone and ceilometer tries to reconnect to it, the connection can hang. This is because, ceilometer monkeypatch only socket and not select, or when kombu detect monkeypatching on the socket module, it assume the select is monkeypatched too and use the real select.select on a eventlet socket, and hang. Ceilometer must enable monkeypatch for select too. Change-Id: Ib41dcde6e5f32755ababf9227827aa8368399c9a Closes-bug: 1288844 --- ceilometer/service.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ceilometer/service.py b/ceilometer/service.py index e53b63770..d3e06f7fb 100644 --- a/ceilometer/service.py +++ b/ceilometer/service.py @@ -108,9 +108,10 @@ class DispatchedService(object): def prepare_service(argv=None): - # NOTE(jd) We need to monkey patch the socket module for, at least, - # oslo.rpc, otherwise everything's blocked on its first read() - eventlet.monkey_patch(socket=True) + # NOTE(jd) We need to monkey patch the socket and select module for, + # at least, oslo.rpc, otherwise everything's blocked on its first read() + # or select() + eventlet.monkey_patch(socket=True, select=True) gettextutils.install('ceilometer', lazy=True) rpc.set_defaults(control_exchange='ceilometer') cfg.set_defaults(log.log_opts,