[tahoe-lafs-trac-stream] [Tahoe-LAFS] #4055: `await_client_ready` waits for the incorrect condition while trying to ensure enough servers are reachable

Tahoe-LAFS trac at tahoe-lafs.org
Tue Aug 1 19:22:16 UTC 2023


#4055: `await_client_ready` waits for the incorrect condition while trying to
ensure enough servers are reachable
---------------------+---------------------------
 Reporter:  exarkun  |          Owner:
     Type:  defect   |         Status:  new
 Priority:  normal   |      Milestone:  undecided
Component:  unknown  |        Version:  n/a
 Keywords:           |  Launchpad Bug:
---------------------+---------------------------
 The function includes this

 {{{
 # 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
 }}}

 The list comprehension will filter out `None` server_times elements but it
 will not filter out non-None elements because the liveness comparison is
 in the result expression instead of the test list.  It just puts bools
 into the resulting list and then checks its length.

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/4055>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list