diff options
author | Zuul <zuul@review.opendev.org> | 2022-04-08 14:44:36 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-04-08 14:44:36 +0000 |
commit | 49ec24c17998482ec1d20a43b3e3190e2e53dca1 (patch) | |
tree | 07d121c2882d09ecf5b4f15a6b92496ab6bac7e0 /oslo_messaging/_drivers/amqp1_driver | |
parent | 3b5a0543e97619ca8f8cf98193f6b6375d77cbf2 (diff) | |
parent | d57eccd862c1a008f9b1f868c0832e938a75415e (diff) | |
download | oslo-messaging-stable/xena.tar.gz |
Merge "amqp1: fix race when reconnecting" into stable/xenaxena-em12.9.4stable/xena
Diffstat (limited to 'oslo_messaging/_drivers/amqp1_driver')
-rw-r--r-- | oslo_messaging/_drivers/amqp1_driver/controller.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/oslo_messaging/_drivers/amqp1_driver/controller.py b/oslo_messaging/_drivers/amqp1_driver/controller.py index bba7228..44a6bb4 100644 --- a/oslo_messaging/_drivers/amqp1_driver/controller.py +++ b/oslo_messaging/_drivers/amqp1_driver/controller.py @@ -1245,6 +1245,7 @@ class Controller(pyngus.ConnectionEventHandler): # service. Try to re-establish the connection: if not self._reconnecting: self._reconnecting = True + self.processor.wakeup(lambda: self._hard_reset(reason)) LOG.info("Delaying reconnect attempt for %d seconds", self._delay) self.processor.defer(lambda: self._do_reconnect(reason), @@ -1261,7 +1262,6 @@ class Controller(pyngus.ConnectionEventHandler): """ self._reconnecting = False if not self._closing: - self._hard_reset(reason) host = self.hosts.next() LOG.info("Reconnecting to: %(hostname)s:%(port)s", {'hostname': host.hostname, 'port': host.port}) @@ -1331,4 +1331,5 @@ class Controller(pyngus.ConnectionEventHandler): def _active(self): # Is the connection up return (self._socket_connection and + self._socket_connection.pyngus_conn and self._socket_connection.pyngus_conn.active) |