Skip to content

Move all loops based on retries to time wait #122

@morenod

Description

@morenod

It is hard to calculate how many time we will wait for each loop when they are based on counting retries

Loops like:

for trying in range(1, 101):
[...]
logging.error("Failed to get namespace for %s on the %s cluster after 100 retries" % (cluster_name, type))

Can be moved to:

wait_time = 30 # (minutes)
starting_time = datetime.datetime.utcnow().timestamp()
while datetime.datetime.utcnow().timestamp() < starting_time + wait_time * 60:
[...]
logging.error("Waiting time expired. After %d minutes there are %d ready nodes (Expected: %d) on cluster %s" % (wait_time, ready_nodes, worker_nodes, cluster_name))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions