Skip to content

translate Retry to Base.retry#548

Merged
bors[bot] merged 17 commits into
masterfrom
eph/base-retry
May 25, 2022
Merged

translate Retry to Base.retry#548
bors[bot] merged 17 commits into
masterfrom
eph/base-retry

Conversation

@ericphanson

@ericphanson ericphanson commented May 11, 2022

Copy link
Copy Markdown
Member

Suggested in #542 (comment)

I'm not sure we should merge this as-is, because before we could do immediate retries OR delay retries, and now we can only do delay retries. I'm also not 100% sure the delay amounts are the same.

The functional approach is nicer than the macro approach though in my opinion, since the retries don't need to be literals. So we could let folks request more retries on a per-request basis, or even put it in the Backend struct.

edit 1: Retry.jl expands to a for-loop, so non-literals are OK. I thought it unrolled the loop.

edit 2: the delay amounts are definitely not the same, but that's a good thing- now we copy the upstream recommendation from https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html. In particular, putting a cap of 20s means we can increase the retries further without danger, xref #550 (we can't do that with Retry.jl since the retries are hard-coded with no cap and get too big- ref #543 (comment)).


12 May update:

I'm now in favor of merging this, because I want to get in #550. The first few retries are pretty short, e.g.

julia> collect(AWS.AWSExponentialBackoff(; max_attempts=10))
9-element Vector{Any}:
  0.3365311959885935
  1.2370247946870188
  2.925043257220695
 12.165245886682294
 20.0
 20.0
  5.5969335490336505
 20.0
 20.0

So I think having a short delay instead of an immediate retry in a few cases is probably OK. Also, the AWS docs don't talk about non-delayed retries, they seem to only do delayed retries.

@ericphanson

Copy link
Copy Markdown
Member Author

Going to check on CI:

bors try

bors Bot added a commit that referenced this pull request May 11, 2022
@bors

bors Bot commented May 11, 2022

Copy link
Copy Markdown
Contributor

try

Build failed:

@ericphanson

Copy link
Copy Markdown
Member Author

bors try

bors Bot added a commit that referenced this pull request May 11, 2022
@bors

bors Bot commented May 11, 2022

Copy link
Copy Markdown
Contributor

try

Build failed:

@ericphanson

Copy link
Copy Markdown
Member Author

bors try

bors Bot added a commit that referenced this pull request May 11, 2022
@bors

bors Bot commented May 11, 2022

Copy link
Copy Markdown
Contributor

try

Build failed:

@ericphanson

Copy link
Copy Markdown
Member Author

bors try

bors Bot added a commit that referenced this pull request May 11, 2022
Comment thread .JuliaFormatter.toml
@@ -0,0 +1 @@
style="blue"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This lets me use "format" command in VSCode

@bors

bors Bot commented May 11, 2022

Copy link
Copy Markdown
Contributor

try

Build failed:

@ericphanson

Copy link
Copy Markdown
Member Author

bors try

bors Bot added a commit that referenced this pull request May 11, 2022
@bors

bors Bot commented May 11, 2022

Copy link
Copy Markdown
Contributor

@ericphanson

Copy link
Copy Markdown
Member Author

bors try

bors Bot added a commit that referenced this pull request May 12, 2022
@bors

bors Bot commented May 19, 2022

Copy link
Copy Markdown
Contributor

try

Build failed:

@ericphanson

Copy link
Copy Markdown
Member Author

bors try

bors Bot added a commit that referenced this pull request May 19, 2022
@bors

bors Bot commented May 19, 2022

Copy link
Copy Markdown
Contributor

try

Build succeeded:

@ericphanson
ericphanson requested a review from omus May 19, 2022 13:18
Comment thread Project.toml Outdated
Comment thread Project.toml Outdated
Comment thread src/utilities/request.jl Outdated
Comment thread src/utilities/request.jl
Comment thread src/utilities/request.jl
Comment thread test/utilities.jl
Co-authored-by: Curtis Vogt <curtis.vogt@gmail.com>
@ericphanson

Copy link
Copy Markdown
Member Author

bors try

bors Bot added a commit that referenced this pull request May 19, 2022
@bors

bors Bot commented May 19, 2022

Copy link
Copy Markdown
Contributor

try

Build failed:

@ericphanson

Copy link
Copy Markdown
Member Author

bors try

bors Bot added a commit that referenced this pull request May 19, 2022
@bors

bors Bot commented May 19, 2022

Copy link
Copy Markdown
Contributor

try

Build failed:

@ericphanson

Copy link
Copy Markdown
Member Author

bors try

bors Bot added a commit that referenced this pull request May 19, 2022
@bors

bors Bot commented May 19, 2022

Copy link
Copy Markdown
Contributor

@ericphanson

Copy link
Copy Markdown
Member Author

Ok! I don't really want to do more formatting changes since it's kind of pain to get it through Bors again. Are there any other changes we should make here? Or is it good to go?

@ericphanson
ericphanson requested a review from omus May 19, 2022 18:44

@omus omus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread test/utilities.jl Outdated
Co-authored-by: Curtis Vogt <curtis.vogt@gmail.com>
@ericphanson

Copy link
Copy Markdown
Member Author

bors r+

@bors

bors Bot commented May 25, 2022

Copy link
Copy Markdown
Contributor

@bors
bors Bot merged commit d52c639 into master May 25, 2022
@bors
bors Bot deleted the eph/base-retry branch May 25, 2022 15:08
bors Bot added a commit that referenced this pull request Mar 20, 2023
549: Add debug logging messages on retry r=mattBrzezinski a=ericphanson

Closes #514

Based on #548

The logging messages are structured so the string is a human-readable summary of the message, and then the fields are  more structured for later analysis, e.g. `retry::Bool`, `reason::String`, etc. Additionally, the id of the log message will be useful for aggregation.

Co-authored-by: Eric Hanson <5846501+ericphanson@users.noreply.github.com>
Co-authored-by: Matt Brzezinski <matt.brzezinski@beacon.bio>
bors Bot added a commit that referenced this pull request Mar 20, 2023
549: Add debug logging messages on retry r=mattBrzezinski a=ericphanson

Closes #514

Based on #548

The logging messages are structured so the string is a human-readable summary of the message, and then the fields are  more structured for later analysis, e.g. `retry::Bool`, `reason::String`, etc. Additionally, the id of the log message will be useful for aggregation.

Co-authored-by: Eric Hanson <5846501+ericphanson@users.noreply.github.com>
Co-authored-by: Matt Brzezinski <matt.brzezinski@beacon.bio>
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.

2 participants