From a7a0248e48af8e7b4f2e504f44097433baa4699b Mon Sep 17 00:00:00 2001 From: Oleg Avdeev Date: Fri, 1 Dec 2023 11:14:52 -0800 Subject: [PATCH] async cache client fix: don't capture stderr since it contains logs --- .../data/cache/client/cache_async_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/ui_backend_service/data/cache/client/cache_async_client.py b/services/ui_backend_service/data/cache/client/cache_async_client.py index 413f87e9..a17a4278 100644 --- a/services/ui_backend_service/data/cache/client/cache_async_client.py +++ b/services/ui_backend_service/data/cache/client/cache_async_client.py @@ -25,7 +25,7 @@ async def start_server(self, cmdline, env): ) self._proc = await asyncio.create_subprocess_exec( - *cmdline, env=env, stdin=PIPE, stdout=PIPE, stderr=STDOUT, limit=1024000 + *cmdline, env=env, stdin=PIPE, stdout=PIPE, stderr=None, limit=1024000 ) # 1024KB asyncio.gather(self._heartbeat(), self.read_stdout()) @@ -47,6 +47,8 @@ async def read_message(self, line: str): # We check for isEnabledFor because some things may be very long to print # (in particularly pending_requests) message = json.loads(line) + if not isinstance(message, dict): + raise Exception("Unexpected message type: {} {}".format(type(message), repr(message))) if self.logger.isEnabledFor(logging.INFO): self.logger.info(message) if message["op"] == OP_WORKER_CREATE: