Skip to content

Commit

Permalink
Fix #7414 write_message binary=True
Browse files Browse the repository at this point in the history
  • Loading branch information
robnagler committed Dec 30, 2024
1 parent 6e0f1ee commit 3d0638e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sirepo/job_driver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def receive(cls, msg):
return
pkdlog("unknown agent, sending kill; msg={}", msg)
try:
msg.handler.write_message(PKDict(opName=job.OP_KILL))
msg.handler.write_message(PKDict(opName=job.OP_KILL), binary=True)
except tornado.websocket.WebSocketClosedError:
pkdlog("websocket closed {} from unknown agent", self)
except Exception as e:
Expand All @@ -179,7 +179,7 @@ def receive(cls, msg):
def send(self, op):
pkdlog("{} {} runDir={}", self, op, op.msg.get("runDir"))
try:
self._websocket.write_message(pkjson.dump_bytes(op.msg))
self._websocket.write_message(pkjson.dump_bytes(op.msg), binary=True)
return True
except tornado.websocket.WebSocketClosedError:
pkdlog("websocket closed op={}", op)
Expand Down
2 changes: 1 addition & 1 deletion sirepo/pkcli/job_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ async def send(self, msg):
try:
if not isinstance(msg, _OpMsg):
raise AssertionError("expected _OpMsg type={} msg={}", type(msg), msg)
await self._websocket.write_message(pkjson.dump_bytes(msg))
await self._websocket.write_message(pkjson.dump_bytes(msg), binary=True)
return True
except Exception as e:
pkdlog("exception={} msg={} stack={}", e, msg, pkdexc())
Expand Down

0 comments on commit 3d0638e

Please sign in to comment.