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

feat: Import tenacity library and use it in cluster_read.py #109

Merged
merged 2 commits into from
Jan 14, 2024

Conversation

pablomh
Copy link
Contributor

@pablomh pablomh commented Jan 12, 2024

Use it to retry POST requests to Grafana which seems to close/reset connections under load.

Tenacity

@@ -178,6 +179,7 @@ def _sanitize_target(self, target):
target = target.replace("$Cloud", self.args.grafana_prefix)
return target

@retry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many times it will retry?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better now?

setup.py Show resolved Hide resolved
Use it to retry POST requests to Grafana which seems to close/reset
connections under load.

[Tenacity](https://tenacity.readthedocs.io/en/latest/)
@pablomh pablomh force-pushed the pablomh-retry branch 6 times, most recently from 40f5c30 to 6b91480 Compare January 12, 2024 23:23
@jhutar jhutar merged commit 13dcf3a into main Jan 14, 2024
6 checks passed
@@ -178,6 +179,8 @@ def _sanitize_target(self, target):
target = target.replace("$Cloud", self.args.grafana_prefix)
return target

# pylint: disable-next=undefined-variable
@retry(stop=(stop_after_delay(10) | stop_after_attempt(10))) # noqa: F405
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

@pablomh pablomh deleted the pablomh-retry branch January 15, 2024 08:58
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

Successfully merging this pull request may close these issues.

2 participants