terraform-provider-http icon indicating copy to clipboard operation
terraform-provider-http copied to clipboard

Feature request: Add timeout and retry option

Open barryib opened this issue 4 years ago • 4 comments

Hi there,

Some time, http servers take some time to respond or are not ready yet to accept requests. It would be nice to add some kind of retry logic and timeout option to handle those use cases.

Please see https://github.com/terraform-providers/terraform-provider-aws/pull/11426 and specially https://github.com/terraform-providers/terraform-provider-aws/pull/11426#issuecomment-703716318.

Perhaps hashicorp/go-retryablehttp can help us to achieve this.

I can open a PR for this. But I want to know if this is something we can add in this provider and if it the right direction.

barryib avatar Oct 05 '20 17:10 barryib

I cant open a PR for this, but i'm interest into this. Like a generic resource .. wait until available.

jkroepke avatar Nov 08 '20 23:11 jkroepke

I would also like to see this feature added. I often get timeout errors such as this:

Error: Error making request: Get "http://ipv4.icanhazip.com": dial tcp 147.75.47.199:80: i/o timeout

ggolub avatar Dec 10 '20 14:12 ggolub

Created https://github.com/hashicorp/terraform-provider-http/pull/71 to add support for client timeout. Handling retries is a bit trickier, as custom logic will be needed. Alternatively, this provider could leverage HashiCorp's own go-retryablehttp library.

jamesgoodhouse avatar Mar 12 '21 16:03 jamesgoodhouse

Hello there,

I also created a PR linked to this issue https://github.com/hashicorp/terraform-provider-http/pull/87 Personally I think it would reduce random errors by retrying but also it can be used as some kind of http waiter.

Vince-Chenal avatar Jun 22 '21 09:06 Vince-Chenal

Timeout and retry have been added into v3.3.0 of the http provider.

bendbennett avatar Apr 25 '23 13:04 bendbennett

@antonbabenko I think we can remove this repo now https://github.com/terraform-aws-modules/terraform-provider-http (leaving the forked version on the registry though for backwards compatibility, users can move back over to this provider when they are ready)

bryantbiggs avatar Aug 05 '23 22:08 bryantbiggs

@bryantbiggs Done - "This repository has been archived by the owner on Aug 6, 2023. It is now read-only."

And we can delete it in the future.

antonbabenko avatar Aug 06 '23 08:08 antonbabenko

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar May 23 '24 15:05 github-actions[bot]