minor fix
This commit is contained in:
1 parent
3b5e358cf3
commit
cd52b7ddbe
1 file changed
+18
-6
+18
-6
@@ -520,21 +520,33 @@ def worker_5():
|
|||||||
#THREAD 5 HELPERS
|
#THREAD 5 HELPERS
|
||||||
def cmd_list_mem():
|
def cmd_list_mem():
|
||||||
with members_list_lock:
|
with members_list_lock:
|
||||||
for member_id, member_data in members_list.items():
|
cluster_state = [
|
||||||
if member_data["state"] == "failed":
|
(
|
||||||
continue
|
m_id,
|
||||||
log(f"{member_id} state = {member_data['state']}, heartbeat = {member_data['heart_beat']}, incarnation = {member_data['incarnation_counter']}")
|
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():
|
def cmd_display_suspects():
|
||||||
with suspect_history_lock:
|
with suspect_history_lock:
|
||||||
if not suspect_history:
|
history_snapshot = list(suspect_history)
|
||||||
|
|
||||||
|
if not history_snapshot:
|
||||||
log("No suspects recorded.")
|
log("No suspects recorded.")
|
||||||
else:
|
else:
|
||||||
log("Suspect history:")
|
log("Suspect history:")
|
||||||
for member_id, timestamp in suspect_history:
|
for member_id, timestamp in history_snapshot:
|
||||||
log(f"{member_id} suspected at {timestamp}")
|
log(f"{member_id} suspected at {timestamp}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# THREAD 6 - Display membership list in a pretty format
|
# THREAD 6 - Display membership list in a pretty format
|
||||||
def worker_monitor():
|
def worker_monitor():
|
||||||
while not stop_threads.is_set():
|
while not stop_threads.is_set():
|
||||||
|
|||||||
Reference in new issue
Block a user