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

Implement retry logic for List() Operations #33

Closed

Conversation

spencerhance
Copy link
Member

List() calls will retry until successful or the context is done. PageToken()
is used to avoid re-trying successful pages.

This should resolve #29

Up for review but hold off on merging since I'm trying to figure out a better way to test this.

List() calls will retry until successful or the context is done.  PageToken()
is used to avoid re-trying successful pages.
@spencerhance spencerhance requested a review from bowei February 5, 2020 21:53
@spencerhance
Copy link
Member Author

@bowei Can you review this since you're the most familiar with this code? Also if you have any suggestions on unit testing that would be appreciated; we don't actually run any of the gen functions in the unit tests.

@bertinatto
Copy link

@spencerhance, @bowei : Thank you for looking into this!

If you think this is the way to go, I can help testing this patch in our CI for a couple of weeks.

@BenTheElder
Copy link

BenTheElder commented Feb 12, 2020

[verifying that prow webhooks work, please excuse this]
/woof

@bertinatto
Copy link

Hi @spencerhance, @bowei. Do you have any thoughts/concerns on this PR?

if nextPageToken != "" {
call.PageToken(nextPageToken)
}
if err := call.Pages(ctx, f); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Are there different kinds of errors we want to handle differently?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so, are there any specific response codes you think we should handle? We don't handle response codes individually in the other functions AFAIK

Choose a reason for hiding this comment

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

@bowei @spencerhance please let me know if you need any help with this! We're seeing some flakes in our CI that I think would be solved with this patch.

@bertinatto
Copy link

@bowei @spencerhance do you need any help testing this?

@spencerhance
Copy link
Member Author

@bowei Is there anything else I need to do to close this out?

@bowei
Copy link
Member

bowei commented Sep 21, 2022

Can we address the question about the kinds of errors we would or wouldn't want to retry? Also, I get concerned that current calls to List() that return with an error when called with a no deadline Context will now just hang.

@bowei
Copy link
Member

bowei commented Apr 26, 2023

Spencer can you update or abandon this PR?

@spencerhance
Copy link
Member Author

Closing for now since it's somewhat of a high risk / low reward PR - callers can always just wrap List() in a retry loop.

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.

GCEInstances.List() doesn't retry
4 participants