#4055 closed defect (fixed)

`await_client_ready` waits for the incorrect condition while trying to ensure enough servers are reachable

Reported by: exarkun Owned by: GitHub <noreply@…>
Priority: normal Milestone: undecided
Component: unknown Version: n/a
Keywords: Cc:
Launchpad Bug:

Description

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.

Change History (1)

comment:1 Changed at 2023-08-02T00:14:28Z by GitHub <noreply@…>

  • Owner set to GitHub <noreply@…>
  • Resolution set to fixed
  • Status changed from new to closed

In a648708/trunk:

Merge pull request #1325 from exarkun/4055.await_client_ready

Fix the minimum-live-servers condition in await_client_ready

Fixes: ticket:4055

Note: See TracTickets for help on using tickets.