From 3f812c4c2c1c322b28a68b3e985006631db872cd Mon Sep 17 00:00:00 2001 From: Steve Fan <19037626d@connect.polyu.hk> Date: Wed, 12 Jan 2022 15:23:37 +0800 Subject: [PATCH] comm_kernel: fix RPC exception handling (#1801) --- artiq/coredevice/comm_kernel.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/artiq/coredevice/comm_kernel.py b/artiq/coredevice/comm_kernel.py index f566c5ff8..37ffd2aeb 100644 --- a/artiq/coredevice/comm_kernel.py +++ b/artiq/coredevice/comm_kernel.py @@ -563,14 +563,6 @@ class CommKernel: try: result = service(*args, **kwargs) - logger.debug("rpc service: %d %r %r = %r", - service_id, args, kwargs, result) - - self._write_header(Request.RPCReply) - self._write_bytes(return_tags) - self._send_rpc_value(bytearray(return_tags), - result, result, service) - self._flush() except RPCReturnValueError as exn: raise except Exception as exn: @@ -617,6 +609,14 @@ class CommKernel: self._write_int32(-1) # column not known self._write_string(function) self._flush() + else: + logger.debug("rpc service: %d %r %r = %r", + service_id, args, kwargs, result) + self._write_header(Request.RPCReply) + self._write_bytes(return_tags) + self._send_rpc_value(bytearray(return_tags), + result, result, service) + self._flush() def _serve_exception(self, embedding_map, symbolizer, demangler): name = self._read_string()