Skip to content

Commit

Permalink
add comments around connection handler
Browse files Browse the repository at this point in the history
  • Loading branch information
anGie44 committed Apr 14, 2022
1 parent 52a92b8 commit ba79126
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/conns/conns.go
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,10 @@ func (c *Config) Client(ctx context.Context) (interface{}, diag.Diagnostics) {
})

client.ECSConn.Handlers.Retry.PushBack(func(r *request.Request) {
// By design the "WaitUntilServicesStable" method will poll every 15 seconds until a successful state
// has been reached. This will exit with a return code of 255 (ResourceNotReady) after 40 failed checks.
// Thus, here we retry the operation a set number of times as
// described in https://github.com/hashicorp/terraform-provider-aws/pull/23747.
if r.Operation.Name == "WaitUntilServicesStable" {
if tfawserr.ErrCodeEquals(r.Error, "ResourceNotReady") {
// We only want to retry briefly as the default max retry count would
Expand Down

0 comments on commit ba79126

Please sign in to comment.