-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Beanstalk environments, bump the minimum timeout between API calls #7523
Conversation
@@ -249,7 +249,7 @@ func resourceAwsElasticBeanstalkEnvironmentCreate(d *schema.ResourceData, meta i | |||
Refresh: environmentStateRefreshFunc(conn, d.Id()), | |||
Timeout: waitForReadyTimeOut, | |||
Delay: 10 * time.Second, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it the delay you want to update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delay is the amount of time before we start. MinTimeout is the minimum amount of time between refreshes:
Delay time.Duration // Wait this time before starting checks
MinTimeout time.Duration // Smallest time to wait before refreshes
I'll be refactoring this PR to expose at least MinTimeout
, stay tuned!
3875d54
to
d2c9cc3
Compare
} | ||
if duration < 10*time.Second || duration > 60*time.Second { | ||
errors = append(errors, fmt.Errorf( | ||
"%q must be between 10s and 60s", k)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10s
is our current minimum. 60s
seemed like a reasonable max, but we can tune it higher if need be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
60s
seems like a reasonable max, I'd agree. You don't want atlas jobs taking forever because of someone's value here. Its a fine line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I like poll_interval
as the variable, seems to be generic that could be added in another providers / resources in the future.
I'm not sure if terraform/helper/resource/state.go Lines 77 to 83 in 2a45b1f
Looks like it's capped at 10s based on that conditional. That's all based on doing exponential backoff. Maybe we need to plumb through a fresh option for a static poll interval if the user requests it? |
Paul and I discussed this and found that I'm going to take another pass and try adding a separate config option that's preferable to the min timeout |
expose a poll_interval for users to configure polling for updates
46b4d51
to
d74c2d5
Compare
@phinze I refactored this to use |
LGTM |
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. |
This is a band-aid to #6870. Beanstalk environments can take a long time to setup, and if you are managing many of them you can hit API rate limits for your account.
A more permanent solution may be to expose a knob to set a customizable timeout / poll interval, but as I mention in #6870 the design of such a knob hasn't been planed out yet.