From d51297dea6f1aea78a49650acedf05550219ea71 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Thu, 21 Sep 2023 14:59:20 +0100 Subject: [PATCH] Note if WebSocket was terminated when logging messages sent out We are seeing cases where WS messages are received and `h.streamer.websocket.WebSocket.send_json` is called, but the reply is never received on the client. Log whether the connection was terminated, to rule that out as the reason. --- h/streamer/websocket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h/streamer/websocket.py b/h/streamer/websocket.py index c5d9e0086d0..d47791bd19f 100644 --- a/h/streamer/websocket.py +++ b/h/streamer/websocket.py @@ -98,7 +98,7 @@ def closed(self, code, reason=None): def send_json(self, payload): if self.debug: - log.info("Sending message %s", payload) + log.info("Sending message %s (terminated: %s)", payload, self.terminated) if not self.terminated: self.send(json.dumps(payload))