Skip to content

Commit

Permalink
Don't tell Qpid to reconnect in a busy loop.
Browse files Browse the repository at this point in the history
Fix bug 929784.

Don't set any of the reconnect timing options unless they have been set
in the configuration.  Setting them all to zero puts Qpid in a mode
where it will reconnect in a busy loop.  By not setting these unless a
non-zero value has been provided, Qpid goes back to its default
behavior, which is to use an exponential backoff on reconnect attempts
(after 1 second, then 2, 4, 8, etc).

Change-Id: Ia587bbe96db9ea6e429af289c3d586f4c6706648
  • Loading branch information
russellb committed Feb 19, 2012
1 parent 86148ed commit b12c20f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions nova/rpc/impl_qpid.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,18 @@ def __init__(self, server_params=None):
self.connection.password = params['password']
self.connection.sasl_mechanisms = FLAGS.qpid_sasl_mechanisms
self.connection.reconnect = FLAGS.qpid_reconnect
self.connection.reconnect_timeout = FLAGS.qpid_reconnect_timeout
self.connection.reconnect_limit = FLAGS.qpid_reconnect_limit
_qpid_reconnect_interval_max = FLAGS.qpid_reconnect_interval_max
self.connection.reconnect_interval_max = _qpid_reconnect_interval_max
_qpid_reconnect_interval_min = FLAGS.qpid_reconnect_interval_min
self.connection.reconnect_interval_min = _qpid_reconnect_interval_min
self.connection.reconnect_interval = FLAGS.qpid_reconnect_interval
if FLAGS.qpid_reconnect_timeout:
self.connection.reconnect_timeout = FLAGS.qpid_reconnect_timeout
if FLAGS.qpid_reconnect_limit:
self.connection.reconnect_limit = FLAGS.qpid_reconnect_limit
if FLAGS.qpid_reconnect_interval_max:
self.connection.reconnect_interval_max = (
FLAGS.qpid_reconnect_interval_max)
if FLAGS.qpid_reconnect_interval_min:
self.connection.reconnect_interval_min = (
FLAGS.qpid_reconnect_interval_min)
if FLAGS.qpid_reconnect_interval:
self.connection.reconnect_interval = FLAGS.qpid_reconnect_interval
self.connection.hearbeat = FLAGS.qpid_heartbeat
self.connection.protocol = FLAGS.qpid_protocol
self.connection.tcp_nodelay = FLAGS.qpid_tcp_nodelay
Expand Down

0 comments on commit b12c20f

Please sign in to comment.