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

Log peering wait errors, use ReadTimeout in peering Data Sources #363

Merged
merged 4 commits into from
Aug 3, 2022

Conversation

jjti
Copy link
Contributor

@jjti jjti commented Jul 29, 2022

🛠️ Description

Occasionally we get what look like timeouts while waiting on Azure peerings to flip to ACTIVE:

TestE2E_BasicAzure 2022-07-29T17:56:40Z logger.go:66: module.hcp_peering.data.hcp_azure_peering_connection.peering: Still reading... [19m50s elapsed]
TestE2E_BasicAzure 2022-07-29T17:56:50Z logger.go:66: 
TestE2E_BasicAzure 2022-07-29T17:56:50Z logger.go:66: Error: error waiting for peering connection (azure-e2e-68625cad-peer) to become 'ACTIVE'
TestE2E_BasicAzure 2022-07-29T17:56:50Z logger.go:66: 
TestE2E_BasicAzure 2022-07-29T17:56:50Z logger.go:66:   with module.hcp_peering.data.hcp_azure_peering_connection.peering,
TestE2E_BasicAzure 2022-07-29T17:56:50Z logger.go:66:   on .terraform/modules/hcp_peering/main.tf line 117, in data "hcp_azure_peering_connection" "peering":
TestE2E_BasicAzure 2022-07-29T17:56:50Z logger.go:66:  117: data "hcp_azure_peering_connection" "peering" {
TestE2E_BasicAzure 2022-07-29T17:56:50Z logger.go:66: 
TestE2E_BasicAzure 2022-07-29T17:56:50Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; 
Error: error waiting for peering connection (azure-e2e-68625cad-peer) to become 'ACTIVE'

  with module.hcp_peering.data.hcp_azure_peering_connection.peering,
  on .terraform/modules/hcp_peering/main.tf line 117, in data "hcp_azure_peering_connection" "peering":
 117: data "hcp_azure_peering_connection" "peering" {
}

This repeatedly happens right at 20 minutes, which is the default timeout. That doesn't make a lot of sense, be we ourselves set the Timeout to 35 minutes in multiple places. The changes in this PR are to 1. try to log failures seen waiting on the peering state transition and 2. set the Read timeout to 35 minutes explicitly (vs using just Timeouts.Default).

🚢 Release Note

Release note for CHANGELOG:

* data_source_azure_peering_connection: log failed peering wait errors [GH-363]

🏗️ Acceptance tests

  • Are there any feature flags that are required to use this functionality?
  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

@jjti jjti changed the title Log peering wait errors Log peering wait errors, use Jul 29, 2022
@jjti jjti marked this pull request as ready for review July 29, 2022 21:27
@jjti jjti requested a review from a team as a code owner July 29, 2022 21:27
@jjti jjti changed the title Log peering wait errors, use Log peering wait errors, use ReadTimeout in peering Data Sources Aug 1, 2022
@bcmdarroch bcmdarroch merged commit 7684238 into main Aug 3, 2022
@bcmdarroch bcmdarroch deleted the jjtimmons/add-logging-to-hcp-azure-peer-timeout branch August 3, 2022 22:07
rizkybiz pushed a commit to rizkybiz/terraform-provider-hcp that referenced this pull request Aug 25, 2022
…hicorp#363)

* Log peering wait errors

* run go generate

* Remove Default timeout

* Also apply Read timeout to aws network peering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants