Skip to content

Commit

Permalink
(t) replication spawn error - continued 6 rockstor#2766
Browse files Browse the repository at this point in the history
- return prior latest_snap name send as message in receiver-ready.
- remove libzmq socker.set_hwm.
  • Loading branch information
phillxnet committed Dec 31, 2023
1 parent 5700577 commit 1f76338
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/rockstor/smart_manager/replication/listener_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def run(self):

ctx = zmq.Context()
frontend = ctx.socket(zmq.ROUTER)
frontend.set_hwm(value=10)
# frontend.set_hwm(value=10)
frontend.bind(f"tcp://{self.listener_interface}:{ self.listener_port}")

backend = ctx.socket(zmq.ROUTER)
Expand Down
14 changes: 12 additions & 2 deletions src/rockstor/smart_manager/replication/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def run(self):
self.poll = zmq.Poller()
self.dealer = self.ctx.socket(zmq.DEALER)
self.dealer.setsockopt_string(zmq.IDENTITY, str(self.identity))
self.dealer.set_hwm(10)
# self.dealer.set_hwm(10)
ipc_socket = settings.REPLICATION.get("ipc_socket")
self.dealer.connect(f"ipc://{ipc_socket}")
self.poll.register(self.dealer, zmq.POLLIN)
Expand Down Expand Up @@ -269,7 +269,11 @@ def run(self):
)

self.msg = b"Failed to send receiver-ready"
rcommand, rmsg = self._send_recv(b"receiver-ready", b"")
# Previously our second parameter was (latest_snap or b"")
snap = latest_snap
if snap is None:
snap = b"place-holder"
rcommand, rmsg = self._send_recv(b"receiver-ready", snap)
if rcommand == b"":
logger.error(
f"Id: {self.identity}. No response from the broker for receiver-ready command. Aborting."
Expand All @@ -282,6 +286,12 @@ def run(self):
t0 = time.time()
while True:
socks = dict(self.poll.poll(poll_interval))
logger.debug(f"RECEIVER socks dict = {socks}")
if socks != {}:
for key in socks:
logger.debug(f"socks index ({key}), has value {socks[key]}")
else:
logger.debug("SOCKS EMPTY")
if socks.get(self.dealer) == zmq.POLLIN:
# reset to wait upto 60(poll_interval x num_tries
# milliseconds) for every message
Expand Down
5 changes: 2 additions & 3 deletions src/rockstor/smart_manager/replication/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,9 @@ def run(self):
)
)

poll_interval = 6000 # 6 seconds
while True:
socks = dict(self.poll.poll(poll_interval))
logger.debug(f"Sender socks dict = {socks}")
socks = dict(self.poll.poll(6000))
logger.debug(f"SENDER socks dict = {socks}")
if socks != {}:
for key in socks:
logger.debug(f"socks index ({key}), has value {socks[key]}")
Expand Down

0 comments on commit 1f76338

Please sign in to comment.