diff --git a/oslo_messaging/rpc/server.py b/oslo_messaging/rpc/server.py index b16d77fa6..d981b88ed 100644 --- a/oslo_messaging/rpc/server.py +++ b/oslo_messaging/rpc/server.py @@ -164,12 +164,18 @@ class RPCServer(msg_server.MessageHandlingServer): try: res = self.dispatcher.dispatch(message) except rpc_dispatcher.ExpectedException as e: - failure = e.exc_info - LOG.debug(u'Expected exception during message handling (%s)', e) - except Exception: # current sys.exc_info() content can be overridden # by another exception raised by a log handler during - # LOG.exception(). So keep a copy and delete it later. + # LOG.debug(). So keep a copy and delete it later. + failure = e.exc_info + LOG.debug(u'Expected exception during message handling (%s)', e) + except rpc_dispatcher.NoSuchMethod as e: + failure = sys.exc_info() + if e.method.endswith('_ignore_errors'): + LOG.debug('Method %s not found', e.method) + else: + LOG.exception('Exception during message handling') + except Exception: failure = sys.exc_info() LOG.exception('Exception during message handling') diff --git a/releasenotes/notes/no-log-if-ignore-errors-e2223b8a646b4c40.yaml b/releasenotes/notes/no-log-if-ignore-errors-e2223b8a646b4c40.yaml new file mode 100644 index 000000000..84365cc87 --- /dev/null +++ b/releasenotes/notes/no-log-if-ignore-errors-e2223b8a646b4c40.yaml @@ -0,0 +1,5 @@ +other: + - | + NoSuchMethod exception will not be logged for special non-existing methods + which names end with '_ignore_errors'. Such methods might be used + as health probes for openstack services.