Skip to content

Commit

Permalink
Merge pull request #59 from perftool-incubator/dev-kmr
Browse files Browse the repository at this point in the history
only emit connection error messages during xread calls if the connect…
  • Loading branch information
k-rister authored Jan 15, 2024
2 parents c11e825 + aac39a1 commit d1f346d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions roadblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,11 +1252,12 @@ def do_heartbeat_signal(self):
def do_timeout(self):
'''Handle a roadblock timeout event'''

self.rc = self.RC_TIMEOUT

self.logger.critical("Roadblock failed with timeout")

self.timeout_internals()

self.rc = self.RC_TIMEOUT
return self.rc

def timeout_signal_handler(self, signum, frame):
Expand Down Expand Up @@ -1622,6 +1623,7 @@ def run_it(self):
self.logger.debug("self.rc != 0 --> breaking")
break

msgs = []
try:
if self.roadblock_role == "follower":
msgs = self.redcon.xread(streams = {
Expand All @@ -1636,8 +1638,12 @@ def run_it(self):
self.roadblock_uuid + "__bus__" + self.my_id: personal_last_msg_id
}, block = 0)
except redis.exceptions.ConnectionError as con_error:
self.logger.error("%s", con_error)
self.logger.error("Bus read failed due to connection error!")
if self.con_pool_state:
self.logger.error("%s", con_error)
self.logger.error("Bus read failed due to connection error!")
else:
self.logger.debug("%s", con_error)
self.logger.debug("Bus read failed because the connection has been closed")
except redis.exceptions.TimeoutError as con_error:
self.logger.error("%s", con_error)
self.logger.error("Bus read failed due to a timeout error!")
Expand Down

0 comments on commit d1f346d

Please sign in to comment.