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

Change logs to use current_exceptions_to_string() instead of exception= pattern #1092

Merged
merged 7 commits into from
Sep 18, 2023

Conversation

NHDaly
Copy link
Collaborator

@NHDaly NHDaly commented Aug 17, 2023

This is a follow-up from #1065, fixing a few more cases of the old logging style.

Also adds a test that at least one of those logs does indeed log the exception details in the string, so we know the exception logging is working as expected.

Finally, cleans up a couple unused variables in catch e in 2 places, and updates Base.catch_stack() to Base. current_exceptions(), which is the new, public API for this which is exported from Base. It starts warning about calling the older, deprecated function in 1.9.

@quinnj
Copy link
Member

quinnj commented Aug 17, 2023

I'm seeing

 Test threw exception
  Expression: close(server)
  UndefVarError: current_exceptions not defined
  Stacktrace:
    [1] current_exceptions_to_string()
      @ HTTP.Exceptions ~/work/HTTP.jl/HTTP.jl/src/Exceptions.jl:103
    [2] shutdown(fn::Main.test_server.var"#shutdown_throw#24")
      @ HTTP.Servers ~/work/HTTP.jl/HTTP.jl/src/Servers.jl:196
    [3] foreach(f::typeof(HTTP.Servers.shutdown), itr::Vector{Function})
      @ Base ./abstractarray.jl:2141

in the 1.6 tests

@NHDaly
Copy link
Collaborator Author

NHDaly commented Aug 18, 2023

Aha, yeah, thanks! 👍

test/server.jl Outdated Show resolved Hide resolved
@nickrobinson251
Copy link
Collaborator

Some tests are not being run... is that intentional?

I couldn't see an issue about it so i opened one: #1093

@quinnj
Copy link
Member

quinnj commented Aug 18, 2023

Some tests are not being run... is that intentional?

I couldn't see an issue about it so i opened one: #1093

Yes, intentional. Thanks for opening the issue as I forgot about it. The downloads tests were relying on a public server that is no longer serving requests in the same way, so they were just constantly failing, so they were disabled. I pinged @oxinabox about it, but I think it's kind of a pain to dig into and figure out what to do instead.

Copy link
Collaborator Author

@NHDaly NHDaly left a comment

Choose a reason for hiding this comment

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

Friendly ping. Can we review and merge this soon? This was making it harder to debug the AT&T incident we encountered, and I'd like to close the repair item.

test/server.jl Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@NHDaly NHDaly left a comment

Choose a reason for hiding this comment

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

Oh, whoops, i didn't realize the test were failing. I pushed up a change that will hopefully fix it. :)

@nickrobinson251
Copy link
Collaborator

Looks like Autobahn Server tests are failing (it seems these tests only run on linux)

Server: Test Failed at /home/runner/work/HTTP.jl/HTTP.jl/test/websockets/autobahn.jl:90
  Expression: v["behavior"] in ("OK", "NON-STRICT", "INFORMATIONAL", "UNIMPLEMENTED")
   Evaluated: "FAILED" in ("OK", "NON-STRICT", "INFORMATIONAL", "UNIMPLEMENTED")

Stacktrace:
 [1] macro expansion
   @ /opt/hostedtoolcache/julia/1.9.3/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:478 [inlined]
 [2] macro expansion
   @ ~/work/HTTP.jl/HTTP.jl/test/websockets/autobahn.jl:90 [inlined]
 [3] macro expansion
   @ /opt/hostedtoolcache/julia/1.9.3/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
 [4] macro expansion
   @ ~/work/HTTP.jl/HTTP.jl/test/websockets/autobahn.jl:80 [inlined]
 [5] macro expansion
   @ /opt/hostedtoolcache/julia/1.9.3/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
 [6] top-level scope
   @ ~/work/HTTP.jl/HTTP.jl/test/websockets/autobahn.jl:22

@NHDaly NHDaly force-pushed the nhd-logging-patterns branch from 2f950b6 to 45b6d92 Compare September 18, 2023 14:20
src/WebSockets.jl Outdated Show resolved Hide resolved
@Drvi
Copy link
Collaborator

Drvi commented Sep 18, 2023

Slightly related to this PR, there is a bad call to current_exceptions_to_string at

err = current_exceptions_to_string(e)

@NHDaly
Copy link
Collaborator Author

NHDaly commented Sep 18, 2023

Slightly related to this PR, there is a bad call to current_exceptions_to_string at

err = current_exceptions_to_string(e)

Thanks, i've fixed that. ... So we're missing code coverage on that error path, yeah?

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2023

Codecov Report

Attention: Patch coverage is 57.14286% with 12 lines in your changes missing coverage. Please review.

Project coverage is 82.67%. Comparing base (bda4ef2) to head (bab328a).
Report is 35 commits behind head on master.

Files with missing lines Patch % Lines
src/clientlayers/ConnectionRequest.jl 0.00% 6 Missing ⚠️
src/clientlayers/StreamRequest.jl 0.00% 2 Missing ⚠️
src/clientlayers/TimeoutRequest.jl 0.00% 2 Missing ⚠️
src/Exceptions.jl 75.00% 1 Missing ⚠️
src/Servers.jl 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1092      +/-   ##
==========================================
+ Coverage   82.49%   82.67%   +0.18%     
==========================================
  Files          32       32              
  Lines        3044     3053       +9     
==========================================
+ Hits         2511     2524      +13     
+ Misses        533      529       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Drvi
Copy link
Collaborator

Drvi commented Sep 18, 2023

Thanks, i've fixed that. ... So we're missing code coverage on that error path, yeah?

Introducing codecov is the right answer:)

@Drvi
Copy link
Collaborator

Drvi commented Sep 18, 2023

The remaining test failures are also flakes from tests that I introduced very recently #1110. There I test that internal exceptions are not retried by expecting the request to finish way sooner than the total retry delays, but now I think I didn't choose good value for that (max waiting time of 3 seconds was perhaps too ambitious). Sorry for that! I think if we bump the total delay and max waiting time by 10x, it should be less flakey.

@NHDaly
Copy link
Collaborator Author

NHDaly commented Sep 18, 2023

Signoff from @Drvi on slack that we can ignore the Invalidations job failure for now. Thanks!

@NHDaly NHDaly merged commit c83d30f into JuliaWeb:master Sep 18, 2023
@NHDaly NHDaly deleted the nhd-logging-patterns branch September 18, 2023 16:10
@NHDaly NHDaly restored the nhd-logging-patterns branch October 2, 2023 15:22
@NHDaly NHDaly deleted the nhd-logging-patterns branch October 2, 2023 15:22
NHDaly added a commit that referenced this pull request Oct 2, 2023
…tion=` pattern (#1092)

* Change logs to use `current_exceptions_to_string()` instead of `exception=`

* cleanup unused variable `catch e`

* Update Exceptions.jl for older julia

* Rename err => msg; fix missing import

* Make "Don't retry on internal exceptions" less flakey

---------

Co-authored-by: Nick Robinson <[email protected]>
Co-authored-by: Tomáš Drvoštěp <[email protected]>
NHDaly added a commit that referenced this pull request Oct 2, 2023
NHDaly added a commit that referenced this pull request Oct 2, 2023
…tead of `exception=` pattern (#1115)

* Change logs to use `current_exceptions_to_string()` instead of `exception=` pattern (#1092)

* Change logs to use `current_exceptions_to_string()` instead of `exception=`

* cleanup unused variable `catch e`

* Update Exceptions.jl for older julia

* Rename err => msg; fix missing import

* Make "Don't retry on internal exceptions" less flakey

---------

Co-authored-by: Nick Robinson <[email protected]>
Co-authored-by: Tomáš Drvoštěp <[email protected]>

* Bump release to v1.9.16 for #1092

---------

Co-authored-by: Nick Robinson <[email protected]>
Co-authored-by: Tomáš Drvoštěp <[email protected]>
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.

5 participants