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
retry in case of empty response while fetching resource #343
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
Hi, Any update on this PR? |
Hi @harshavmb , Thank you so much for taking time to work on this feature! And apologize for the late response. We'll think about this feature request and improve it. |
We received a related feature request: #372 |
Hi @ms-henglu , I'm afraid the feature request you linked isn't the one this PR is about. It's not the resource, it's a data provider. |
I think #372 could cover both data sources and resources, using a common retry function. |
Although, it might be a different scenario if the API does not return an error (which, I think it should) |
Hi @matt-FFFFFF , Indeed if you prefer to have a common function, both resources & data sources could use that but I would like to have this available with data sources too as we have different use-cases than the one mentioned in #372. |
Hi folks. How is this one looking? This feature would be extremely useful and looks like a lot of the hard work has been done. |
This PR is an additional
retry
function withazapi_resource
data provider.The use case for this
retry
logic is that we have few Azure policies to update DNS configuration ofprivate endpoints
created by various users. There is some slight delay between the private endpoint resource creation & the Azure policy to create A-record & update the private endpoint DNS configuration. We have seen the time lag of up to 30-40 seconds.Currently, we are using either
null_resource
&sleep
providers. We wait deliberately for certain time expecting the configuration to be updated. Nevertheless, it's not a clean solution. We create inherent dependency onaz-cli
.With this
retry
logic,azapi_resource
data provider retries until non empty response is returned by the Azure API.I know retrying bluntly on empty response isn't wise but I'm open to your suggestions.