minor fix
This commit is contained in:
1 parent
3b5e358cf3
commit
cd52b7ddbe
1 file changed
+22
-10
+22
-10
@@ -520,19 +520,31 @@ def worker_5():
|
||||
#THREAD 5 HELPERS
|
||||
def cmd_list_mem():
|
||||
with members_list_lock:
|
||||
for member_id, member_data in members_list.items():
|
||||
if member_data["state"] == "failed":
|
||||
continue
|
||||
log(f"{member_id} state = {member_data['state']}, heartbeat = {member_data['heart_beat']}, incarnation = {member_data['incarnation_counter']}")
|
||||
cluster_state = [
|
||||
(
|
||||
m_id,
|
||||
m_data["state"],
|
||||
m_data["heart_beat"],
|
||||
m_data["incarnation_counter"],
|
||||
)
|
||||
for m_id, m_data in members_list.items()
|
||||
if m_data["state"] != "failed"
|
||||
]
|
||||
|
||||
for m_id, state, hb, inc in cluster_state:
|
||||
log(f"{m_id} state = {state}, heartbeat = {hb}, incarnation = {inc}")
|
||||
|
||||
def cmd_display_suspects():
|
||||
with suspect_history_lock:
|
||||
if not suspect_history:
|
||||
log("No suspects recorded.")
|
||||
else:
|
||||
log("Suspect history:")
|
||||
for member_id, timestamp in suspect_history:
|
||||
log(f"{member_id} suspected at {timestamp}")
|
||||
history_snapshot = list(suspect_history)
|
||||
|
||||
if not history_snapshot:
|
||||
log("No suspects recorded.")
|
||||
else:
|
||||
log("Suspect history:")
|
||||
for member_id, timestamp in history_snapshot:
|
||||
log(f"{member_id} suspected at {timestamp}")
|
||||
|
||||
|
||||
|
||||
# THREAD 6 - Display membership list in a pretty format
|
||||
|
||||
Reference in new issue
Block a user