It's OK if some nodes are down.

This commit is contained in:
Itamar Turner-Trauring 2023-06-12 12:00:12 -04:00
parent eba1ed0226
commit 939f0ded25

View File

@ -631,16 +631,9 @@ def await_client_ready(tahoe, timeout=10, liveness=60*2, minimum_number_of_serve
server['last_received_data']
for server in servers
]
# if any times are null/None that server has never been
# contacted (so it's down still, probably)
never_received_data = server_times.count(None)
if never_received_data > 0:
print(f"waiting because {never_received_data} server(s) not contacted")
time.sleep(1)
continue
# check that all times are 'recent enough'
if any([time.time() - t > liveness for t in server_times]):
# check that all times are 'recent enough' (it's OK if _some_ servers
# are down, we just want to make sure a sufficient number are up)
if len([time.time() - t <= liveness for t in server_times if t is not None]) < minimum_number_of_servers:
print("waiting because at least one server too old")
time.sleep(1)
continue