Skip to content

Add debug logging messages on retry#549

Closed
ericphanson wants to merge 11 commits into
masterfrom
eph/log-retries
Closed

Add debug logging messages on retry#549
ericphanson wants to merge 11 commits into
masterfrom
eph/log-retries

Conversation

@ericphanson

Copy link
Copy Markdown
Member

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.

@ericphanson

Copy link
Copy Markdown
Member Author

Let's see if CI likes it:

bors try

bors Bot added a commit that referenced this pull request May 11, 2022
Comment thread src/utilities/request.jl Outdated
@bors

bors Bot commented May 11, 2022

Copy link
Copy Markdown
Contributor

@christopher-dG christopher-dG 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!

@ericphanson

Copy link
Copy Markdown
Member Author

ok great! I think we should probably first review/merge #548, then merge this on top.

Comment thread test/issues.jl Outdated
Comment thread test/issues.jl
Base automatically changed from eph/base-retry to master May 25, 2022 15:08

@mattBrzezinski mattBrzezinski 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.

bors r+

@bors

bors Bot commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Merge conflict.

ericphanson and others added 6 commits March 20, 2023 15:45
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

@mattBrzezinski mattBrzezinski 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.

bors r+

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

bors Bot commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Build failed:

@mattBrzezinski

Copy link
Copy Markdown
Member

bors r+

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>
return nothing
end

check = (s, e) -> begin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
check = (s, e) -> begin
check =
(s, e) -> begin

Comment thread src/utilities/downloads_backend.jl Outdated

check = (s, e) -> begin
if isa(e, HTTP.StatusError) && AWS._http_status(e) >= 500
@debug "AWS.jl Downloads inner retry for status >= 500" retry=true reason="status >= 500" status=_http_status(e) exception=e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@debug "AWS.jl Downloads inner retry for status >= 500" retry=true reason="status >= 500" status=_http_status(e) exception=e
@debug "AWS.jl Downloads inner retry for status >= 500" retry = true reason = "status >= 500" status = _http_status(
e
) exception = e

@debug "AWS.jl Downloads inner retry for status >= 500" retry=true reason="status >= 500" status=_http_status(e) exception=e
return true
elseif isa(e, Downloads.RequestError)
@debug "AWS.jl Downloads inner retry for Downloads.RequestError" retry=true reason="Downloads.RequestError" exception=e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@debug "AWS.jl Downloads inner retry for Downloads.RequestError" retry=true reason="Downloads.RequestError" exception=e
@debug "AWS.jl Downloads inner retry for Downloads.RequestError" retry =
true reason = "Downloads.RequestError" exception = e

@debug "AWS.jl Downloads inner retry for Downloads.RequestError" retry=true reason="Downloads.RequestError" exception=e
return true
else
@debug "AWS.jl Downloads inner retry declined" retry=false reason="Exception passed onwards" exception=e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@debug "AWS.jl Downloads inner retry declined" retry=false reason="Exception passed onwards" exception=e
@debug "AWS.jl Downloads inner retry declined" retry = false reason = "Exception passed onwards" exception =
e

Comment thread src/utilities/request.jl
Comment on lines +159 to 164
check = (s, e) -> begin
# Pass on non-AWS exceptions.
if !(e isa AWSException)
@debug "AWS.jl declined to retry non-AWSException" retry=false reason="Non-AWSException" exception=e
return false
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
check = (s, e) -> begin
# Pass on non-AWS exceptions.
if !(e isa AWSException)
@debug "AWS.jl declined to retry non-AWSException" retry=false reason="Non-AWSException" exception=e
return false
end
check =
(s, e) -> begin
# Pass on non-AWS exceptions.
if !(e isa AWSException)
@debug "AWS.jl declined to retry non-AWSException" retry = false reason = "Non-AWSException" exception =
e
return false
end

Comment thread src/utilities/request.jl
if isa(e, error)
@debug "AWS.jl HTTP inner retry for $error" retry = true reason = "$error" exception =
e
return true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
return true
) exception = e
return true

Comment thread src/utilities/request.jl Outdated
Comment on lines +271 to +273
end
if (isa(e, HTTP.StatusError) && _http_status(e) >= 500)
@debug "AWS.jl HTTP inner retry for status >= 500" retry = true reason = "status >= 500" status = AWS._http_status(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
if (isa(e, HTTP.StatusError) && _http_status(e) >= 500)
@debug "AWS.jl HTTP inner retry for status >= 500" retry = true reason = "status >= 500" status = AWS._http_status(
@debug "AWS.jl HTTP inner retry declined" retry = false reason = "Exception passed onwards" exception =

Comment thread src/utilities/request.jl Outdated
Comment on lines +275 to +276
) exception = e
return true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
) exception = e
return true
return false

Comment thread src/utilities/request.jl Outdated
Comment on lines +278 to +281
@debug "AWS.jl HTTP inner retry declined" retry = false reason = "Exception passed onwards" exception =
e
return false
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@debug "AWS.jl HTTP inner retry declined" retry = false reason = "Exception passed onwards" exception =
e
return false
end

Comment thread test/issues.jl
Comment on lines +9 to +10
record.level == Logging.Debug &&
get(record.kwargs, :retry, nothing) == successful

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
record.level == Logging.Debug &&
get(record.kwargs, :retry, nothing) == successful
record.level == Logging.Debug && get(record.kwargs, :retry, nothing) == successful

@bors

bors Bot commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Build failed:

@mattBrzezinski

Copy link
Copy Markdown
Member

bors try

bors Bot added a commit that referenced this pull request Mar 20, 2023
@bors

bors Bot commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

try

Build failed:

Comment thread src/utilities/request.jl
e = AWSException(e, stream)
rethrow(e)
elseif !(e isa AWSException)
@debug "AWS.jl declined to retry non-AWSException" retry=false reason="Non-AWSException" exception=e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@debug "AWS.jl declined to retry non-AWSException" retry=false reason="Non-AWSException" exception=e
@debug "AWS.jl declined to retry non-AWSException" retry = false reason = "Non-AWSException" exception =
e

@mattBrzezinski

Copy link
Copy Markdown
Member

bors try

bors Bot added a commit that referenced this pull request Mar 20, 2023
@bors

bors Bot commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

try

Build failed:

@mattBrzezinski

Copy link
Copy Markdown
Member

bors try

bors Bot added a commit that referenced this pull request Mar 20, 2023

check = (s, e) -> begin
if isa(e, HTTP.StatusError) && AWS._http_status(e) >= 500
@debug "AWS.jl Downloads inner retry for status >= 500" retry=true reason="status >= 500" status=AWS._http_status(e) exception=e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@debug "AWS.jl Downloads inner retry for status >= 500" retry=true reason="status >= 500" status=AWS._http_status(e) exception=e
@debug "AWS.jl Downloads inner retry for status >= 500" retry = true reason = "status >= 500" status = AWS._http_status(
e
) exception = e

Comment thread src/utilities/request.jl
Comment on lines +258 to +262
check = (s, e) -> begin
errors = (Sockets.DNSError, HTTP.ParseError, Base.IOError)
for error in errors
if isa(e, error)
@debug "AWS.jl HTTP inner retry for $error" retry=true reason="$error" exception=e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
check = (s, e) -> begin
errors = (Sockets.DNSError, HTTP.ParseError, Base.IOError)
for error in errors
if isa(e, error)
@debug "AWS.jl HTTP inner retry for $error" retry=true reason="$error" exception=e
check =
(s, e) -> begin
errors = (Sockets.DNSError, HTTP.ParseError, Base.IOError)
for error in errors
if isa(e, error)
@debug "AWS.jl HTTP inner retry for $error" retry = true reason = "$error" exception =
e
return true
end
end
if (isa(e, HTTP.StatusError) && _http_status(e) >= 500)
@debug "AWS.jl HTTP inner retry for status >= 500" retry = true reason = "status >= 500" status = _http_status(
e
) exception = e

Comment thread src/utilities/request.jl
@debug "AWS.jl HTTP inner retry for $error" retry=true reason="$error" exception=e
return true
end
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
@debug "AWS.jl HTTP inner retry declined" retry = false reason = "Exception passed onwards" exception =
e
return false
end

Comment thread src/utilities/request.jl
Comment on lines +266 to +272
if (isa(e, HTTP.StatusError) && _http_status(e) >= 500)
@debug "AWS.jl HTTP inner retry for status >= 500" retry=true reason="status >= 500" status=_http_status(e) exception=e
return true
end
@debug "AWS.jl HTTP inner retry declined" retry=false reason="Exception passed onwards" exception=e
return false
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
if (isa(e, HTTP.StatusError) && _http_status(e) >= 500)
@debug "AWS.jl HTTP inner retry for status >= 500" retry=true reason="status >= 500" status=_http_status(e) exception=e
return true
end
@debug "AWS.jl HTTP inner retry declined" retry=false reason="Exception passed onwards" exception=e
return false
end

@mattBrzezinski

Copy link
Copy Markdown
Member

bors try

@bors

bors Bot commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

try

Already running a review

@bors

bors Bot commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

try

Build failed:

@mattBrzezinski

Copy link
Copy Markdown
Member

bors try

bors Bot added a commit that referenced this pull request Mar 21, 2023
@bors

bors Bot commented Mar 21, 2023

Copy link
Copy Markdown
Contributor

try

Build failed:

@mattBrzezinski

Copy link
Copy Markdown
Member

Discussed offline, but we'll be revising how to properly introduce debugging here, closing this PR for now.

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.

Emit debug logs on retry?

4 participants