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

feature request: user configurable retryable errors

Open matt-FFFFFF opened this issue 2 years ago • 8 comments

Hi,

I would like to propose that the resources contained within this provider have an additional schema property to identify retryable errors.

With any complex cloud infrastructure, retryable errors are a fact of life. We could make our customers' lives easier by allowing them (and module authors) the ability to configure retries.

Inspiration: https://pkg.go.dev/github.com/cenkalti/backoff

Proposed configuration

resource "azapi_resource" "example" {
  # usual resource properties

  # Retry configuration
  retry {
    interval_seconds     = 5    # mandatory
    randomization_factor = 0.5  # optional, default is 0.5
    multiplier           = 2    # optional, default is 2
    error_message_regex  = [
      "my error message",
      "end of error message$"
    ]
  }

  # Retry will continue up to configured timeouts
  timeouts {
    create = "10m"
  }
}

matt-FFFFFF avatar Nov 10 '23 12:11 matt-FFFFFF

@lonegunmanb would be great to get your thoughts on this based on our recent conversations!

matt-FFFFFF avatar Nov 10 '23 12:11 matt-FFFFFF

Thanks for asking @matt-FFFFFF , I would like to add max_attempts and max_interval.

max_attempts is easy to understand, but if the multiplier is big, it might lead a too long interval that makes this exponential backoff unreasonable, in that case would a max_interval solve this issue?

lonegunmanb avatar Nov 10 '23 13:11 lonegunmanb

This seems a sensible suggestion 👍

matt-FFFFFF avatar Nov 10 '23 13:11 matt-FFFFFF

Just adding a comment in support of this idea!

tony-box avatar Dec 06 '23 14:12 tony-box

Hi @ms-henglu I have started work on this. Hope that's ok?

matt-FFFFFF avatar Dec 08 '23 17:12 matt-FFFFFF

@matt-FFFFFF @ms-henglu who will be working on seeing this completion? Just want to clarify so that we make sure the work doesn't sit idle.

stemaMSFT avatar Jun 27 '24 18:06 stemaMSFT

I'm happy to take this on. ETA end of August.

matt-FFFFFF avatar Jun 27 '24 22:06 matt-FFFFFF

That's great! Thank you @matt-FFFFFF !

ms-henglu avatar Jul 01 '24 02:07 ms-henglu