Merge "rabbit: fixes a logging issue"
This commit is contained in:
commit
7bbd6e4769
@ -552,7 +552,7 @@ class Connection(object):
|
|||||||
failover_strategy="shuffle",
|
failover_strategy="shuffle",
|
||||||
heartbeat=self.driver_conf.heartbeat_timeout_threshold)
|
heartbeat=self.driver_conf.heartbeat_timeout_threshold)
|
||||||
|
|
||||||
LOG.info(_LI('Connecting to AMQP server on %(hostname)s:%(port)d'),
|
LOG.info(_LI('Connecting to AMQP server on %(hostname)s:%(port)s'),
|
||||||
self.connection.info())
|
self.connection.info())
|
||||||
|
|
||||||
# NOTE(sileht): kombu recommend to run heartbeat_check every
|
# NOTE(sileht): kombu recommend to run heartbeat_check every
|
||||||
@ -577,7 +577,7 @@ class Connection(object):
|
|||||||
if purpose == rpc_amqp.PURPOSE_SEND:
|
if purpose == rpc_amqp.PURPOSE_SEND:
|
||||||
self._heartbeat_start()
|
self._heartbeat_start()
|
||||||
|
|
||||||
LOG.info(_LI('Connected to AMQP server on %(hostname)s:%(port)d'),
|
LOG.info(_LI('Connected to AMQP server on %(hostname)s:%(port)s'),
|
||||||
self.connection.info())
|
self.connection.info())
|
||||||
|
|
||||||
# NOTE(sileht):
|
# NOTE(sileht):
|
||||||
@ -691,11 +691,11 @@ class Connection(object):
|
|||||||
info.update(self.connection.info())
|
info.update(self.connection.info())
|
||||||
|
|
||||||
if 'Socket closed' in six.text_type(exc):
|
if 'Socket closed' in six.text_type(exc):
|
||||||
LOG.error(_LE('AMQP server %(hostname)s:%(port)d closed'
|
LOG.error(_LE('AMQP server %(hostname)s:%(port)s closed'
|
||||||
' the connection. Check login credentials:'
|
' the connection. Check login credentials:'
|
||||||
' %(err_str)s'), info)
|
' %(err_str)s'), info)
|
||||||
else:
|
else:
|
||||||
LOG.error(_LE('AMQP server on %(hostname)s:%(port)d is '
|
LOG.error(_LE('AMQP server on %(hostname)s:%(port)s is '
|
||||||
'unreachable: %(err_str)s. Trying again in '
|
'unreachable: %(err_str)s. Trying again in '
|
||||||
'%(sleep_time)d seconds.'), info)
|
'%(sleep_time)d seconds.'), info)
|
||||||
|
|
||||||
@ -721,9 +721,8 @@ class Connection(object):
|
|||||||
consumer.declare(self)
|
consumer.declare(self)
|
||||||
|
|
||||||
LOG.info(_LI('Reconnected to AMQP server on '
|
LOG.info(_LI('Reconnected to AMQP server on '
|
||||||
'%(hostname)s:%(port)d'),
|
'%(hostname)s:%(port)s'),
|
||||||
{'hostname': self.connection.hostname,
|
self.connection.info())
|
||||||
'port': self.connection.port})
|
|
||||||
|
|
||||||
def execute_method(channel):
|
def execute_method(channel):
|
||||||
self._set_current_channel(channel)
|
self._set_current_channel(channel)
|
||||||
@ -761,13 +760,11 @@ class Connection(object):
|
|||||||
self._set_current_channel(None)
|
self._set_current_channel(None)
|
||||||
# NOTE(sileht): number of retry exceeded and the connection
|
# NOTE(sileht): number of retry exceeded and the connection
|
||||||
# is still broken
|
# is still broken
|
||||||
|
info = {'err_str': exc, 'retry': retry}
|
||||||
|
info.update(self.connection.info())
|
||||||
msg = _('Unable to connect to AMQP server on '
|
msg = _('Unable to connect to AMQP server on '
|
||||||
'%(hostname)s:%(port)d after %(retry)s '
|
'%(hostname)s:%(port)s after %(retry)s '
|
||||||
'tries: %(err_str)s') % {
|
'tries: %(err_str)s') % info
|
||||||
'hostname': self.connection.hostname,
|
|
||||||
'port': self.connection.port,
|
|
||||||
'err_str': exc,
|
|
||||||
'retry': retry}
|
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exceptions.MessageDeliveryFailure(msg)
|
raise exceptions.MessageDeliveryFailure(msg)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user