Skip to content

Commit

Permalink
(t) replication spawn error - continued 3 rockstor#2766
Browse files Browse the repository at this point in the history
- more debug logging
- remove receiver 'latest_snap or b""' to simplify for debug.
  • Loading branch information
phillxnet committed Dec 29, 2023
1 parent 3c765b3 commit 3d89af3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rockstor/smart_manager/replication/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,15 @@ def _delete_old_snaps(self, share_name, share_path, num_retain):
return self._delete_old_snaps(share_name, share_path, num_retain)

def _send_recv(self, command: bytes, msg: bytes = b""):
logger.debug(f"_send_recv called with command: {command}, msg: {msg}.")
rcommand = rmsg = None
self.dealer.send_multipart([command, msg])
# Retry logic doesn't make sense atm. So one long patient wait.
socks = dict(self.poll.poll(60000)) # 60 seconds.
if socks.get(self.dealer) == zmq.POLLIN:
rcommand, rmsg = self.dealer.recv_multipart()
logger.debug(f"Id: {self.identity} command: {command} rcommand: {rcommand}")
logger.debug((f"remote message: {rmsg}"))
return rcommand, rmsg

def _latest_snap(self, rso):
Expand Down Expand Up @@ -265,7 +267,7 @@ def run(self):
)

self.msg = b"Failed to send receiver-ready"
rcommand, rmsg = self._send_recv(b"receiver-ready", latest_snap or b"")
rcommand, rmsg = self._send_recv(b"receiver-ready", b"")
if rcommand is None:
logger.error(
f"Id: {self.identity}. No response from the broker for receiver-ready command. Aborting."
Expand Down
1 change: 1 addition & 0 deletions src/rockstor/smart_manager/replication/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def run(self):
poll_interval = 6000 # 6 seconds
while True:
socks = dict(self.poll.poll(poll_interval))
logger.debug(f"Sender socks dict = {socks}")
if socks.get(self.send_req) == zmq.POLLIN:
# not really necessary because we just want one reply for
# now.
Expand Down

0 comments on commit 3d89af3

Please sign in to comment.