Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
User a more accurate max_delay for reconnects
Browse files Browse the repository at this point in the history
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
  • Loading branch information
flaper87 committed Mar 10, 2014
1 parent 3107e46 commit 8b628d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openstack/common/rpc/impl_qpid.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def reconnect(self):
"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(_LI('Connected to AMQP server on %s'), broker)
break
Expand Down

0 comments on commit 8b628d1

Please sign in to comment.