Revert "Add RPC incoming and reply log"
This broke non-rabbitmq message bus drivers. See:
https://bugs.launchpad.net/oslo.messaging/+bug/1855775
This reverts commit b104f254ab
.
Change-Id: I17a448a768b544482b375b0076889db989e03e8c
This commit is contained in:
parent
37fabdd895
commit
859e0d4eaa
@ -16,7 +16,6 @@
|
|||||||
import copy
|
import copy
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
import uuid
|
|
||||||
|
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from six import moves
|
from six import moves
|
||||||
@ -30,7 +29,6 @@ class FakeIncomingMessage(base.RpcIncomingMessage):
|
|||||||
super(FakeIncomingMessage, self).__init__(ctxt, message)
|
super(FakeIncomingMessage, self).__init__(ctxt, message)
|
||||||
self.requeue_callback = requeue
|
self.requeue_callback = requeue
|
||||||
self._reply_q = reply_q
|
self._reply_q = reply_q
|
||||||
self.msg_id = str(uuid.uuid4())
|
|
||||||
|
|
||||||
def reply(self, reply=None, failure=None):
|
def reply(self, reply=None, failure=None):
|
||||||
if self._reply_q:
|
if self._reply_q:
|
||||||
|
@ -122,7 +122,6 @@ A simple example of an RPC server with multiple endpoints might be::
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
import time
|
|
||||||
|
|
||||||
from oslo_messaging import exceptions
|
from oslo_messaging import exceptions
|
||||||
from oslo_messaging.rpc import dispatcher as rpc_dispatcher
|
from oslo_messaging.rpc import dispatcher as rpc_dispatcher
|
||||||
@ -152,12 +151,6 @@ class RPCServer(msg_server.MessageHandlingServer):
|
|||||||
|
|
||||||
def _process_incoming(self, incoming):
|
def _process_incoming(self, incoming):
|
||||||
message = incoming[0]
|
message = incoming[0]
|
||||||
rpc_method = message.message.get('method')
|
|
||||||
start = time.time()
|
|
||||||
LOG.debug("Receive incoming message with id %(msg_id)s and "
|
|
||||||
"method: %(method)s.",
|
|
||||||
{"msg_id": message.msg_id,
|
|
||||||
"method": rpc_method})
|
|
||||||
|
|
||||||
# TODO(sileht): We should remove that at some point and do
|
# TODO(sileht): We should remove that at some point and do
|
||||||
# this directly in the driver
|
# this directly in the driver
|
||||||
@ -183,19 +176,8 @@ class RPCServer(msg_server.MessageHandlingServer):
|
|||||||
try:
|
try:
|
||||||
if failure is None:
|
if failure is None:
|
||||||
message.reply(res)
|
message.reply(res)
|
||||||
LOG.debug("Replied success message with id %(msg_id)s and "
|
|
||||||
"method: %(method)s. Time elapsed: %(elapsed).3f",
|
|
||||||
{"msg_id": message.msg_id,
|
|
||||||
"method": rpc_method,
|
|
||||||
"elapsed": (time.time() - start)})
|
|
||||||
else:
|
else:
|
||||||
message.reply(failure=failure)
|
message.reply(failure=failure)
|
||||||
LOG.debug("Replied failure for incoming message with "
|
|
||||||
"id %(msg_id)s and method: %(method)s. "
|
|
||||||
"Time elapsed: %(elapsed).3f",
|
|
||||||
{"msg_id": message.msg_id,
|
|
||||||
"method": rpc_method,
|
|
||||||
"elapsed": (time.time() - start)})
|
|
||||||
except exceptions.MessageUndeliverable as e:
|
except exceptions.MessageUndeliverable as e:
|
||||||
LOG.exception(
|
LOG.exception(
|
||||||
"MessageUndeliverable error, "
|
"MessageUndeliverable error, "
|
||||||
|
@ -400,7 +400,7 @@ class TestRPCServer(test_utils.BaseTestCase, ServerSetupMixin):
|
|||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
self.assertIsInstance(ex, ValueError)
|
self.assertIsInstance(ex, ValueError)
|
||||||
self.assertEqual('dsfoo', str(ex))
|
self.assertEqual('dsfoo', str(ex))
|
||||||
self.assertTrue(len(debugs) == 2)
|
self.assertTrue(len(debugs) == 0)
|
||||||
self.assertGreater(len(errors), 0)
|
self.assertGreater(len(errors), 0)
|
||||||
else:
|
else:
|
||||||
self.assertTrue(False)
|
self.assertTrue(False)
|
||||||
|
Loading…
Reference in New Issue
Block a user