summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2014-02-18 10:56:21 +0100
committerFlavio Percoco <flaper87@gmail.com>2014-03-28 14:14:02 +0100
commita96d1a44bc0f074729c312e5c2a0f0875edf1765 (patch)
treeddfae0229a8a1ea16a80d98532b03ccd89cc29d6
parent0fff959041f959495e4dcfbdaf3805d47d7858c8 (diff)
downloadkeystone-a96d1a44bc0f074729c312e5c2a0f0875edf1765.tar.gz
User a more accurate max_delay for reconnects2013.2.3
In an HA deployment, a 60 seconds delay between reconnects can be quite problematic. This patch changes the delay calculation by setting the max delay to 5s and by changing the way it is increased. Unfortunately, this is one of the places where both our main drivers are not consistent. Rabbit's driver uses configuration parameters for this whereas qpid's driver has never had one. However, I would prefer not adding configuration paremeters to qpid's driver for the following reasons: 1. Most of OpenStack services depend on the messaging layer, hence they need it to be available. A 5s delay seems to be reasonable and I could argue the need of tune it further. Although so frequent reconnects can add load to the network, that wouldn't be the main issue if one of the brokers go down. 2. We're trying to move away from configuration options towards using transport URL. This path is still not clear and I would prefer avoiding adding new options until we clear it out. Closes-bug: #1281148 Change-Id: I537015f452eb770acba41fdedfe221628f52a920 (cherry picked from commit 8b628d1e024f787dbb93d508117d9148388c0590)
-rw-r--r--keystone/openstack/common/rpc/impl_qpid.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/keystone/openstack/common/rpc/impl_qpid.py b/keystone/openstack/common/rpc/impl_qpid.py
index aa585aa0b..cad438886 100644
--- a/keystone/openstack/common/rpc/impl_qpid.py
+++ b/keystone/openstack/common/rpc/impl_qpid.py
@@ -517,7 +517,7 @@ class Connection(object):
"Sleeping %(delay)s seconds") % msg_dict
LOG.error(msg)
time.sleep(delay)
- delay = min(2 * delay, 60)
+ delay = min(delay + 1, 5)
else:
LOG.info(_('Connected to AMQP server on %s'), broker)
break