Don't log each received messages

oslo.utils.strutils.mask_password take too much time on
big payload (nova-conductor can receive payload ~ 66k in
largeops jobs for example).

This change removes this logging until we make mask_password
more efficient or we have a smarted the oslo.messaging logging to
not log everything.

Change-Id: Ib1f1d70c5cb820e8ff2de10e6064037808ea1f3a
Closes-bug: #1408362
This commit is contained in:
Mehdi Abaakouk 2015-01-07 17:50:44 +01:00
parent 84f18e8167
commit c18f9f7c61
3 changed files with 9 additions and 10 deletions

View File

@ -32,6 +32,7 @@ import six
from oslo.config import cfg
from oslo.messaging._drivers import common as rpc_common
from oslo.messaging._drivers import pool
from oslo.utils import strutils
amqp_opts = [
cfg.BoolOpt('amqp_durable_queues',
@ -164,7 +165,8 @@ def unpack_context(conf, msg):
context_dict['reply_q'] = msg.pop('_reply_q', None)
context_dict['conf'] = conf
ctx = RpcContext.from_dict(context_dict)
rpc_common._safe_log(LOG.debug, 'unpacked context: %s', ctx.to_dict())
LOG.debug(u'unpacked context: %s',
strutils.mask_password(six.text_type(ctx.to_dict())))
return ctx

View File

@ -96,11 +96,14 @@ class AMQPListener(base.Listener):
self._stopped = threading.Event()
def __call__(self, message):
# FIXME(markmc): logging isn't driver specific
rpc_common._safe_log(LOG.debug, 'received %s', dict(message))
ctxt = rpc_amqp.unpack_context(self.conf, message)
# FIXME(sileht): Don't log the message until strutils is more
# efficient, (rpc_amqp.unpack_context already log the context)
# LOG.debug(u'received: %s',
# strutils.mask_password(six.text_type(dict(message))))
unique_id = self.msg_id_cache.check_duplicate_message(message)
ctxt = rpc_amqp.unpack_context(self.conf, message)
self.incoming.append(AMQPIncomingMessage(self,
ctxt.to_dict(),

View File

@ -27,7 +27,6 @@ from oslo import messaging
from oslo.messaging._i18n import _
from oslo.messaging import _utils as utils
from oslo.serialization import jsonutils
from oslo.utils import strutils
LOG = logging.getLogger(__name__)
@ -161,11 +160,6 @@ class Connection(object):
raise NotImplementedError()
def _safe_log(log_func, msg, msg_data):
"""Sanitizes the msg_data field before logging."""
return log_func(msg, strutils.mask_password(six.text_type(msg_data)))
def serialize_remote_exception(failure_info, log_failure=True):
"""Prepares exception data to be sent over rpc.