Browse Source

Add a info log when a reconnection occurs

This change adds a info log when a reconnection occurs
like we have before.

Change-Id: I3b7d86894efac09e27125c368fc83e83c36b630e
changes/11/138411/6
Mehdi Abaakouk 7 years ago
parent
commit
31a149a4df
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      oslo/messaging/_drivers/impl_rabbit.py

+ 8
- 2
oslo/messaging/_drivers/impl_rabbit.py View File

@ -34,6 +34,7 @@ from oslo.messaging._drivers import amqp as rpc_amqp
from oslo.messaging._drivers import amqpdriver
from oslo.messaging._drivers import common as rpc_common
from oslo.messaging._i18n import _
from oslo.messaging._i18n import _LI
from oslo.messaging import exceptions
from oslo.utils import netutils
@ -504,13 +505,13 @@ class Connection(object):
self._url, ssl=self._ssl_params, login_method=self._login_method,
failover_strategy="shuffle")
LOG.info(_('Connecting to AMQP server on %(hostname)s:%(port)d'),
LOG.info(_LI('Connecting to AMQP server on %(hostname)s:%(port)d'),
{'hostname': self.connection.hostname,
'port': self.connection.port})
# NOTE(sileht): just ensure the connection is setuped at startup
self.ensure(error_callback=None,
method=lambda channel: True)
LOG.info(_('Connected to AMQP server on %(hostname)s:%(port)d'),
LOG.info(_LI('Connected to AMQP server on %(hostname)s:%(port)d'),
{'hostname': self.connection.hostname,
'port': self.connection.port})
@ -632,6 +633,11 @@ class Connection(object):
for consumer in self.consumers:
consumer.reconnect(new_channel)
LOG.info(_LI('Reconnected to AMQP server on '
'%(hostname)s:%(port)d'),
{'hostname': self.connection.hostname,
'port': self.connection.port})
recoverable_errors = (self.connection.recoverable_channel_errors +
self.connection.recoverable_connection_errors)
try:


Loading…
Cancel
Save