-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
marten-seemann
commented
Dec 2, 2020
- only print it once
- link to the wiki page: https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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.
packet_handler_map.go
Outdated
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) |
There was a problem hiding this comment.
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
packet_handler_map_test.go
Outdated
@@ -63,6 +66,7 @@ var _ = Describe("Packet Handler Map", func() { | |||
}) | |||
|
|||
JustBeforeEach(func() { | |||
log.SetOutput(ioutil.Discard) |
There was a problem hiding this comment.
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.
e3e663d
to
b0974c1
Compare