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

Retry extra handling #161

Merged
merged 7 commits into from Apr 13, 2022
Merged

Retry extra handling #161

merged 7 commits into from Apr 13, 2022

Conversation

gavriel-hc
Copy link
Contributor

Sometimes a request can "succeed" but fail later and in order to retry the later things, we have to retry the whole request. This PR adds an option to pass a "response handler" to deal with this situation.

The tests were failing (some genuinely, some because of new vet rules)

Asana

@hashicorp-cla
Copy link

hashicorp-cla commented Apr 11, 2022

CLA assistant check
All committers have signed the CLA.

roundtripper_test.go Outdated Show resolved Hide resolved
Copy link
Member

@ryanuber ryanuber left a comment

Choose a reason for hiding this comment

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

Not bad! I think we could clean up the interface a tad, and I left a comment about the retry trigger being a bool vs an error that I think we should consider.

roundtripper_test.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
client.go Show resolved Hide resolved
gavriel-hc and others added 2 commits April 12, 2022 20:31
Co-authored-by: Ryan Uber <ru@ryanuber.com>
Copy link
Member

@ryanuber ryanuber left a comment

Choose a reason for hiding this comment

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

Looks great! Only minor tweaks regarding naming and logging, otherwise this seems solid. 👍

client.go Outdated Show resolved Hide resolved
client.go Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
Copy link
Member

@ryanuber ryanuber left a comment

Choose a reason for hiding this comment

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

LGTM! 🚢

@gavriel-hc gavriel-hc merged commit 98169fe into master Apr 13, 2022
@gavriel-hc gavriel-hc deleted the retry-extra-handling branch April 13, 2022 22:59
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

3 participants