Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all loops based on retries to time wait #122

Open
morenod opened this issue Mar 6, 2023 · 0 comments
Open

Move all loops based on retries to time wait #122

morenod opened this issue Mar 6, 2023 · 0 comments

Comments

@morenod
Copy link
Collaborator

morenod commented Mar 6, 2023

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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant