Skip to content

Commit

Permalink
(t) replication spawn error - fix rouge byte.encode() rockstor#2766
Browse files Browse the repository at this point in the history
  • Loading branch information
phillxnet committed Jan 5, 2024
1 parent 9a24c14 commit 48cf26d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rockstor/smart_manager/replication/listener_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ def run(self):
elif backend in events and events[backend] == zmq.POLLIN:
# backend.recv_multipart() returns all as type <class 'bytes'>
address, command, msg = backend.recv_multipart()
# In the following conditional:
# if redefines msg as str
# elif leaves msg as bytes
if command == b"new-send":
rid = int(msg)
logger.debug(f"new-send request received for {rid}")
Expand Down Expand Up @@ -339,7 +342,7 @@ def run(self):
# a new receiver has started. reply to the sender that
# must be waiting
logger.debug(f"command: {command}, sending to frontend.")
tracker = frontend.send_multipart([address, command, msg.encode("utf-8")], copy=False, track=True)
tracker = frontend.send_multipart([address, command, msg], copy=False, track=True)
if not tracker.done:
logger.debug(f"Waiting max 2 seconds for send of commmand ({command})")
# https://pyzmq.readthedocs.io/en/latest/api/zmq.html#notdone
Expand Down

0 comments on commit 48cf26d

Please sign in to comment.