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

Put default and configured timeouts to InstanceState for using the timeouts while Observe calls #309

Merged

Conversation

sergenyalcin
Copy link
Member

This PR puts default and configured timeouts to InstanceState for using the timeouts while Observe calls. We had already passed the timeouts to InstanceDiff. This covers the Create, Update, and Delete calls. However, we also need to put the timeouts to InstanceState for' Observe' calls.

We caught the issue while working on the provider-gcp storage.Bucket resource. There is a retry mechanism for Observe calls in the terraform provider for the following reason:

There seems to be some eventual consistency errors in some cases, so we want to check a few times to ensure it exists before moving on.

Also, if we do not set timeouts to resource, the TF provider sets the timeouts to 20m by default. When a user tries to create a new bucket, this operation is stuck for 20m on a retry loop in the Observation state and does not return anything. So, this blocks the creation of this resource.

It seems we have already observed this issue before and set a timeout here for the storage.Bucket resource. To activate this overridden timeout, we must pass these values to the InstanceState, as I mentioned above.

Description of your changes

Fixes #

I have:

  • Read and followed Upjet's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Tested in provider-gcp by using the storage.Bucket resource manually.

@sergenyalcin
Copy link
Member Author

@ulucinar As we discussed offline, first, I put the timeouts to the Connect function. Then, I checked the situation on the Observe before setting the state. It seems we do not override the timeouts back. I mean, the timeouts remain as we set it. However, being on the safe side, we may consider adding the timeouts again in the Observe function.

…imeouts while Observe calls

Signed-off-by: Sergen Yalçın <[email protected]>
Copy link
Collaborator

@ulucinar ulucinar left a comment

Choose a reason for hiding this comment

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

Thanks @sergenyalcin, lgtm.

@sergenyalcin sergenyalcin merged commit a978820 into crossplane:main Dec 5, 2023
7 checks passed
@sergenyalcin sergenyalcin deleted the set-timeouts-instancestate branch December 5, 2023 15:14
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