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

fix: handling timeouts with proper error messages #924

Merged
merged 7 commits into from
Oct 16, 2024
Merged

Conversation

diya-dhan
Copy link
Contributor

@diya-dhan diya-dhan commented Oct 15, 2024

Purpose

fix #916

When a timeout occurs and the subscription hasn't reached the target state, the plugin would crash without providing a readable error message. While the logic for generating a relevant error is already in place, the absence of a check for "nil" responses causes the execution to terminate abruptly. This PR resolves the issue by adding the necessary check and enhancing the error message for better clarity.

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[x] Bugfix
[ ] Feature
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Test the code via automated test
go test ./...

What to Check

Verify that the following are valid:

  • Automated tests are executed successfully

Checklist for reviewer

The following organizational tasks must be completed before merging this PR:

  • The PR is assigned to the Terraform project and a status is set (typically "in review").
  • The PR has the matching labels assigned to it.
  • The PR has a milestone assigned to it.
  • If the PR closes an issue, the issue is referenced.
  • Possible follow-up items are created and linked.

@diya-dhan diya-dhan added the bug Something isn't working label Oct 15, 2024
@diya-dhan diya-dhan added this to the 1.8.0 milestone Oct 15, 2024
@diya-dhan diya-dhan self-assigned this Oct 15, 2024
Copy link
Member

@lechnerc77 lechnerc77 left a comment

Choose a reason for hiding this comment

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

General remark: If we fix this here, we should make sure that the handling in the other resoures that support a timeout is consistent:

  • subaccount_service_instance -> looks good, but please cross check
  • subaccount_environment_instance -> Create and Update is missing the return when waiting for the state change

@lechnerc77 lechnerc77 merged commit 6c85ef9 into main Oct 16, 2024
15 checks passed
@lechnerc77 lechnerc77 deleted the issue_916 branch October 16, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Terraform scripts crashed during long running subscription
2 participants