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

Final retries for kinesis applications #8984

Merged
merged 1 commit into from
Jun 13, 2019
Merged

Final retries for kinesis applications #8984

merged 1 commit into from
Jun 13, 2019

Conversation

ryndaniels
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

References #7873

Release note for CHANGELOG:

BUG FIXES:
* resource/aws_kinesis_analytics_application - Final retries for AWS timeout errors

Output from acceptance testing:

$ make testacc TESTARGS="-run=TestAccAWSKinesisAnalyticsApplication"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSKinesisAnalyticsApplication -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSKinesisAnalyticsApplication_basic
=== PAUSE TestAccAWSKinesisAnalyticsApplication_basic
=== RUN   TestAccAWSKinesisAnalyticsApplication_update
=== PAUSE TestAccAWSKinesisAnalyticsApplication_update
=== RUN   TestAccAWSKinesisAnalyticsApplication_addCloudwatchLoggingOptions
=== PAUSE TestAccAWSKinesisAnalyticsApplication_addCloudwatchLoggingOptions
=== RUN   TestAccAWSKinesisAnalyticsApplication_updateCloudwatchLoggingOptions
=== PAUSE TestAccAWSKinesisAnalyticsApplication_updateCloudwatchLoggingOptions
=== RUN   TestAccAWSKinesisAnalyticsApplication_inputsKinesisFirehose
=== PAUSE TestAccAWSKinesisAnalyticsApplication_inputsKinesisFirehose
=== RUN   TestAccAWSKinesisAnalyticsApplication_inputsKinesisStream
=== PAUSE TestAccAWSKinesisAnalyticsApplication_inputsKinesisStream
=== RUN   TestAccAWSKinesisAnalyticsApplication_inputsAdd
=== PAUSE TestAccAWSKinesisAnalyticsApplication_inputsAdd
=== RUN   TestAccAWSKinesisAnalyticsApplication_inputsUpdateKinesisStream
=== PAUSE TestAccAWSKinesisAnalyticsApplication_inputsUpdateKinesisStream
=== RUN   TestAccAWSKinesisAnalyticsApplication_outputsKinesisStream
=== PAUSE TestAccAWSKinesisAnalyticsApplication_outputsKinesisStream
=== RUN   TestAccAWSKinesisAnalyticsApplication_outputsMultiple
=== PAUSE TestAccAWSKinesisAnalyticsApplication_outputsMultiple
=== RUN   TestAccAWSKinesisAnalyticsApplication_outputsAdd
=== PAUSE TestAccAWSKinesisAnalyticsApplication_outputsAdd
=== RUN   TestAccAWSKinesisAnalyticsApplication_outputsUpdateKinesisStream
=== PAUSE TestAccAWSKinesisAnalyticsApplication_outputsUpdateKinesisStream
=== RUN   TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Add
=== PAUSE TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Add
=== RUN   TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Create
=== PAUSE TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Create
=== RUN   TestAccAWSKinesisAnalyticsApplication_referenceDataSource
=== PAUSE TestAccAWSKinesisAnalyticsApplication_referenceDataSource
=== RUN   TestAccAWSKinesisAnalyticsApplication_referenceDataSourceUpdate
=== PAUSE TestAccAWSKinesisAnalyticsApplication_referenceDataSourceUpdate
=== RUN   TestAccAWSKinesisAnalyticsApplication_tags
=== PAUSE TestAccAWSKinesisAnalyticsApplication_tags
=== CONT  TestAccAWSKinesisAnalyticsApplication_basic
=== CONT  TestAccAWSKinesisAnalyticsApplication_tags
=== CONT  TestAccAWSKinesisAnalyticsApplication_update
=== CONT  TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Create
=== CONT  TestAccAWSKinesisAnalyticsApplication_referenceDataSourceUpdate
=== CONT  TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Add
=== CONT  TestAccAWSKinesisAnalyticsApplication_outputsUpdateKinesisStream
=== CONT  TestAccAWSKinesisAnalyticsApplication_outputsAdd
=== CONT  TestAccAWSKinesisAnalyticsApplication_outputsMultiple
=== CONT  TestAccAWSKinesisAnalyticsApplication_outputsKinesisStream
=== CONT  TestAccAWSKinesisAnalyticsApplication_inputsUpdateKinesisStream
=== CONT  TestAccAWSKinesisAnalyticsApplication_inputsAdd
=== CONT  TestAccAWSKinesisAnalyticsApplication_inputsKinesisStream
=== CONT  TestAccAWSKinesisAnalyticsApplication_inputsKinesisFirehose
=== CONT  TestAccAWSKinesisAnalyticsApplication_referenceDataSource
=== CONT  TestAccAWSKinesisAnalyticsApplication_updateCloudwatchLoggingOptions
=== CONT  TestAccAWSKinesisAnalyticsApplication_addCloudwatchLoggingOptions
--- PASS: TestAccAWSKinesisAnalyticsApplication_basic (29.92s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_update (46.68s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Create (54.26s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_addCloudwatchLoggingOptions (60.69s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSource (68.79s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Add (71.56s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_updateCloudwatchLoggingOptions (78.10s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_tags (83.27s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsKinesisStream (114.00s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisStream (114.29s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSourceUpdate (126.80s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsMultiple (129.33s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsAdd (134.30s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsAdd (135.11s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisFirehose (147.99s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsUpdateKinesisStream (207.88s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsUpdateKinesisStream (213.19s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       214.320s

@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label Jun 13, 2019
@ryndaniels ryndaniels added the bug Addresses a defect in current functionality. label Jun 13, 2019
@ryndaniels ryndaniels requested a review from bflad June 13, 2019 12:13
@bflad bflad added the service/kinesisanalytics Issues and PRs that pertain to the kinesisanalytics service. label Jun 13, 2019
@bflad bflad added this to the v2.15.0 milestone Jun 13, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one non-blocking nit for the future. 🚀

--- PASS: TestAccAWSKinesisAnalyticsApplication_basic (13.68s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_update (18.79s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSource (19.22s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_tags (28.68s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSourceUpdate (28.74s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_addCloudwatchLoggingOptions (30.01s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Create (32.68s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_updateCloudwatchLoggingOptions (41.59s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Add (43.23s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsMultiple (93.26s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisStream (94.60s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsAdd (105.27s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsKinesisStream (106.37s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsAdd (112.53s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisFirehose (112.67s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsUpdateKinesisStream (170.12s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsUpdateKinesisStream (170.05s)

@@ -614,6 +614,13 @@ func resourceAwsKinesisAnalyticsApplicationCreate(d *schema.ResourceData, meta i
d.SetId(aws.StringValue(output.ApplicationSummary.ApplicationARN))
return nil
})

if isResourceTimeoutError(err) {
var output *kinesisanalytics.CreateApplicationOutput
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The updated code could simplify this handling by having this variable declaration before the original resource.Retry() and calling d.SetId() after all errors have been checked, e.g.

var output *kinesisanalytics.CreateApplicationOutput
err := resource.Retry(1*time.Minute, func() *resource.RetryError {
	var err error
	output, err = conn.CreateApplication(createOpts)
	if err != nil {
		/* ... existing error handling ... */
	}
	return nil
}
if isResourceTimeoutError(err) {
	output, err = conn.CreateApplication(createOpts)
}
if err != nil {
	return fmt.Errorf("error creating Kinesis Analytics Application: %s", err)
}
d.SetId(aws.StringValue(output.ApplicationSummary.ApplicationARN))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! Will keep an eye out for this in future files!

@bflad bflad merged commit cab6db1 into master Jun 13, 2019
@bflad bflad deleted the rfd-retry-kinesis branch June 13, 2019 19:39
bflad added a commit that referenced this pull request Jun 13, 2019
@ghost
Copy link

ghost commented Nov 3, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/kinesisanalytics Issues and PRs that pertain to the kinesisanalytics service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants