fix(gateway): fanout transport uses the shared serialization guard too
Third json.dumps twin of the same class (multi-client fanout of one session): route through transport.serialize_frame so every peer gets the -32603 frame instead of the writer raising.
This commit is contained in:
@@ -237,8 +237,9 @@ class FanoutTransport:
|
||||
return
|
||||
|
||||
def write(self, obj: dict) -> bool:
|
||||
# Freeze the queued frame so a caller cannot mutate it after admission.
|
||||
encoded = json.dumps(obj, ensure_ascii=False)
|
||||
# Freeze the queued frame so a caller cannot mutate it after admission. Same serialization
|
||||
# guard as the single-peer transports: an unserializable frame reaches every peer as -32603.
|
||||
encoded = serialize_frame(obj, "fanout", logger)
|
||||
size = len(encoded.encode("utf-8", errors="surrogatepass"))
|
||||
frame = json.loads(encoded)
|
||||
with self._lock:
|
||||
|
||||
Reference in New Issue
Block a user