Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Conversation

@flokli
Copy link
Contributor

@flokli flokli commented Sep 2, 2021

If set to nonzero, this will attempt to retry requests if they have something recoverable (such as an error >= 500, or
error == 423).

This should probably use some more advanced libraries already providing all sorts of backoff strategies as
https://github.com/sethgrid/pester/, but considering passing in a cleanhttp struct is somewhat part of its external API,
and "this repository being no longer being maintained", as you're "in the process of creating your next generation API
clients", it probably shouldn't be changed.

If set to nonzero, this will attempt to retry requests if they have something recoverable (such as an error >= 500, or
error == 423).

This should probably use some more advanced libraries already providing all sorts of backoff strategies as
https://github.com/sethgrid/pester/, but considering passing in a cleanhttp struct is somewhat part of its external API,
and "this repository being no longer being maintained", as you're "in the process of creating your next generation API
clients", simply adding a bit of (dumb) retry logic is probably better than nothing.

That way, NumRetries can be set in clients, such as the terraform-provider-grafana, which should workaround terraform
issues when trying to describe resources in a (suspended/booting up) Grafana instance
(grafana/terraform-provider-grafana#250)
@flokli flokli force-pushed the support-num-retries branch from f241273 to d119eb3 Compare September 2, 2021 14:27
Copy link
Contributor

@julienduchesne julienduchesne left a comment

Choose a reason for hiding this comment

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

This LGTM. I tested it on the grafana TF provider test suites and it worked. So I'm going to go ahead and merge this

@julienduchesne julienduchesne merged commit c957748 into grafana:master Nov 9, 2021
@flokli flokli deleted the support-num-retries branch November 9, 2021 16:41
@flokli
Copy link
Contributor Author

flokli commented Nov 9, 2021

Thanks! Now we should be able to set NumRetries in terraform-provider-grafana to fix grafana/terraform-provider-grafana#250, right?

flokli added a commit to flokli/terraform-provider-grafana that referenced this pull request Nov 9, 2021
julienduchesne pushed a commit to flokli/terraform-provider-grafana that referenced this pull request Nov 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants