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
This commit is contained in:
Mehdi Abaakouk
2014-03-06 17:28:11 +01:00
parent 2356e2b985
commit 10300af4f5

View File

@@ -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,