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

feature request: user configurable retryable errors #372

Open
matt-FFFFFF opened this issue Nov 10, 2023 · 5 comments · May be fixed by #392
Open

feature request: user configurable retryable errors #372

matt-FFFFFF opened this issue Nov 10, 2023 · 5 comments · May be fixed by #392
Labels
enhancement New feature or request

Comments

@matt-FFFFFF
Copy link
Member

matt-FFFFFF commented Nov 10, 2023

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
Copy link
Member Author

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

@lonegunmanb
Copy link
Member

lonegunmanb commented Nov 10, 2023

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?

@matt-FFFFFF
Copy link
Member Author

This seems a sensible suggestion 👍

@tony-box
Copy link

tony-box commented Dec 6, 2023

Just adding a comment in support of this idea!

@matt-FFFFFF
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants