Skip to content

feat(compute/metadata): retry error when talking to metadata service#4648

Merged
codyoss merged 5 commits intogoogleapis:masterfrom
codyoss:metadata-retry
Aug 19, 2021
Merged

feat(compute/metadata): retry error when talking to metadata service#4648
codyoss merged 5 commits intogoogleapis:masterfrom
codyoss:metadata-retry

Conversation

@codyoss
Copy link
Copy Markdown
Member

@codyoss codyoss commented Aug 19, 2021

This was reported internally to be causing issues. This package is
used by some of our auth flows so it should be good to make this
package more resilient to transient failures. Implementation inspired
by what we do for some of our http based services.

Because this package is currently not context aware I needed to add
attempts so retrying does not happen forever. Five attempts was
arbitrarily chosen.

Fixes: #4642

Release-As: 0.94.0

This was reported internally to be causing issues. This package is
used by some of our auth flows so it should be good to make this
package more resilient to transient failures. Implmentation inspired
by what we do for some of our http based services.

Because this package is currently not context aware I needed to add
attempts so retrying does not happen forever. Five attempts was
arbitrarily chosen.

Fixes: #4642
@codyoss codyoss requested a review from a team August 19, 2021 17:18
@product-auto-label product-auto-label Bot added the api: compute Issues related to the Compute Engine API. label Aug 19, 2021
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 19, 2021
@codyoss codyoss added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed cla: yes This human has signed the Contributor License Agreement. api: compute Issues related to the Compute Engine API. labels Aug 19, 2021
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 19, 2021
@codyoss
Copy link
Copy Markdown
Member Author

codyoss commented Aug 19, 2021

Temporarily adding don't merge while I deploy and test this code on the platform.

Comment thread compute/metadata/retry.go Outdated
Comment thread compute/metadata/metadata.go Outdated
@codyoss codyoss removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 19, 2021
@codyoss
Copy link
Copy Markdown
Member Author

codyoss commented Aug 19, 2021

everything seems to be in working order, tested on the platform.

@codyoss codyoss requested review from broady, noahdietz and tbpg August 19, 2021 20:06
Comment thread compute/metadata/metadata.go Outdated
Comment thread compute/metadata/retry_linux_test.go Outdated
Comment thread compute/metadata/retry_linux_test.go Outdated
Comment thread compute/metadata/retry_test.go Outdated
Comment thread compute/metadata/metadata.go
@codyoss codyoss requested a review from tbpg August 19, 2021 20:38
@codyoss codyoss merged commit 81c6039 into googleapis:master Aug 19, 2021
@codyoss codyoss deleted the metadata-retry branch August 19, 2021 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compute/metadata: add retries

3 participants