diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py index 11b1bae99..eb6d11ab6 100644 --- a/oslo_messaging/_drivers/impl_rabbit.py +++ b/oslo_messaging/_drivers/impl_rabbit.py @@ -607,7 +607,8 @@ class Connection(object): self._heartbeat_support_log_emitted = False # NOTE(sileht): just ensure the connection is setuped at startup - self.ensure_connection() + with self._connection_lock: + self.ensure_connection() # NOTE(sileht): if purpose is PURPOSE_LISTEN # the consume code does the heartbeat stuff