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

Add idempotent excon option to some route53 API calls #40

Merged
merged 1 commit into from
Jan 26, 2015

Conversation

josacar
Copy link
Contributor

@josacar josacar commented Jan 26, 2015

This PR add idempotent attribute to underlying request calls to retry in case AWS throws a 400 error.

Affected API calls:

  • ChangeResourceRecordSetsRequest
  • GetHostedZone
  • ListResourceRecordSets

geemus added a commit that referenced this pull request Jan 26, 2015
Add idempotent excon option to some route53 API calls
@geemus geemus merged commit b60f189 into fog:master Jan 26, 2015
@geemus
Copy link
Member

geemus commented Jan 26, 2015

Thanks!

@@ -141,6 +141,7 @@ def change_resource_record_sets(zone_id, change_batch, options = {})
body = %Q{<?xml version="1.0" encoding="UTF-8"?><ChangeResourceRecordSetsRequest xmlns="https://route53.amazonaws.com/doc/#{@version}/">#{changes}</ChangeResourceRecordSetsRequest>}
request({
:body => body,
:idempotent => true,
Copy link
Member

Choose a reason for hiding this comment

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

is this ok for retries despite being a POST ?

Copy link
Member

Choose a reason for hiding this comment

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

I wondered the same thing. Usually I would say no (post generally creates things). So far as I can tell this is more like a put (updating the record) and it just replaces values. So I think you could re-replace with the same values as often or as many times as you might want without negative impact. Definitely let me know if I misunderstood though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As it should be performed atomically, this must be idempotent as doc says.

Copy link
Member

Choose a reason for hiding this comment

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

@josacar thanks for the further clarification.

Copy link
Member

Choose a reason for hiding this comment

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

@josacar thanks

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.

3 participants