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

improve the warning about the UDP receive buffer size #2923

Merged
merged 2 commits into from
Dec 4, 2020

Conversation

marten-seemann
Copy link
Member

@codecov
Copy link

codecov bot commented Dec 2, 2020

Codecov Report

Merging #2923 (e3e663d) into master (a76879c) will increase coverage by 0.02%.
The diff coverage is 63.64%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2923      +/-   ##
==========================================
+ Coverage   85.77%   85.79%   +0.02%     
==========================================
  Files         133      133              
  Lines        9180     9178       -2     
==========================================
  Hits         7874     7874              
+ Misses        958      956       -2     
  Partials      348      348              
Impacted Files Coverage Δ
packet_handler_map.go 73.71% <63.64%> (+0.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a76879c...b0974c1. Read the comment docs.

Copy link

@mvdan mvdan left a comment

Choose a reason for hiding this comment

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

I assume a test for this would be overkill :) SGTM modulo two nits.

setReceiveBuffer(c, logger)
if err := setReceiveBuffer(c, logger); err != nil {
receiveBufferWarningOnce.Do(func() {
log.Printf("%s. See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.\n", err)
Copy link

Choose a reason for hiding this comment

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

nit: logs already end in newlines, so you don't need the trailing newline

@@ -63,6 +66,7 @@ var _ = Describe("Packet Handler Map", func() {
})

JustBeforeEach(func() {
log.SetOutput(ioutil.Discard)
Copy link

Choose a reason for hiding this comment

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

This is not thread-safe, so I would honestly do it at the start of TestMain and not worry about setting it back to anything else. I assume none of the tests should log directly to stderr, anyway.

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