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

Robust retries for workspace get-status #3550

Merged
merged 4 commits into from
May 7, 2024
Merged

Robust retries for workspace get-status #3550

merged 4 commits into from
May 7, 2024

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented May 6, 2024

Changes

To reduce flakiness of Terraform when calling Workspace Get Status, I've added retries around GetStatusByPath for all usages of this API in the Terraform provider (aside from the exporter, which depends on a field that isn't yet exposed in the SDK). This should help increase stability of fetching the status of notebooks and directories in the provider.

This change introduces a utility to retry on timeout for this common use case. We may want to add this to the Go SDK if we feel it is generally useful as a retry option (e.g. retries.OnRequestTimeout).

Longer term, we should handle these retries for idempotent APIs directly in the SDK.

Tests

Unit tests verify that this retries on timeouts but otherwise doesn't retry.

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • relevant acceptance tests are passing
  • using Go SDK

@mgyucht mgyucht requested review from a team as code owners May 6, 2024 17:16
@mgyucht mgyucht requested review from hectorcast-db and removed request for a team May 6, 2024 17:16
Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

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

code wise looks good, we just need to fix imports

@mgyucht mgyucht enabled auto-merge May 7, 2024 07:38
@mgyucht mgyucht added this pull request to the merge queue May 7, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 76.19048% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 82.66%. Comparing base (774cc97) to head (567e275).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3550      +/-   ##
==========================================
- Coverage   82.70%   82.66%   -0.05%     
==========================================
  Files         183      184       +1     
  Lines       18829    18857      +28     
==========================================
+ Hits        15573    15588      +15     
- Misses       2340     2351      +11     
- Partials      916      918       +2     
Files Coverage Δ
common/retry.go 100.00% <100.00%> (ø)
workspace/data_directory.go 100.00% <100.00%> (ø)
workspace/resource_directory.go 87.69% <100.00%> (+0.39%) ⬆️
workspace/resource_workspace_file.go 84.41% <100.00%> (+0.41%) ⬆️
workspace/data_notebook.go 89.83% <66.66%> (-2.77%) ⬇️
workspace/resource_notebook.go 85.16% <33.33%> (-6.74%) ⬇️

Merged via the queue into main with commit a30518e May 7, 2024
5 checks passed
@mgyucht mgyucht deleted the retry-get-status branch May 7, 2024 07:43
tanmay-db added a commit that referenced this pull request May 13, 2024
### New Features and Improvements
* fix ([#3542](#3542)).
* Update data_aws_crossaccount_policy to format resource string with account and region ([#3544](#3544)).
* Robust retries for workspace get-status ([#3550](#3550)).
* Fix error message typo in mounts.go ([#3552](#3552)).
* State the options for run_if ([#3548](#3548)).
* Exporter: don't emit all UC objects when handling dependencies ([#3556](#3556)).
* Added state upgrader to remove `max_clusters_per_user` and ebs volume attributes set to zero ([#3551](#3551)).
* Exporter: track removed objects during the `Emit` phase ([#3554](#3554)).
* Jobs GoSDK schema migration ([#3532](#3532)).
* Exporter: optimize generation of `databricks_group_member` resource ([#3559](#3559)).

### Documentation Changes

### Exporter

### Internal Changes
@tanmay-db tanmay-db mentioned this pull request May 13, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 14, 2024
* Release v1.43.0

### New Features and Improvements
* fix ([#3542](#3542)).
* Update data_aws_crossaccount_policy to format resource string with account and region ([#3544](#3544)).
* Robust retries for workspace get-status ([#3550](#3550)).
* Fix error message typo in mounts.go ([#3552](#3552)).
* State the options for run_if ([#3548](#3548)).
* Exporter: don't emit all UC objects when handling dependencies ([#3556](#3556)).
* Added state upgrader to remove `max_clusters_per_user` and ebs volume attributes set to zero ([#3551](#3551)).
* Exporter: track removed objects during the `Emit` phase ([#3554](#3554)).
* Jobs GoSDK schema migration ([#3532](#3532)).
* Exporter: optimize generation of `databricks_group_member` resource ([#3559](#3559)).

### Documentation Changes

### Exporter

### Internal Changes

* -

* -

* -
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.

None yet

4 participants