-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Close the span writer on main #2096
Close the span writer on main #2096
Conversation
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #2096 +/- ##
==========================================
+ Coverage 96.31% 96.33% +0.01%
==========================================
Files 214 214
Lines 10535 10537 +2
==========================================
+ Hits 10147 10151 +4
+ Misses 330 328 -2
Partials 58 58
Continue to review full report at Codecov.
|
if err != nil { | ||
logger.Error("failed to close span writer", zap.Error(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.
what about all-in-one, should it have similar code?
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.
It does already, which is the cause for the double-close:
Lines 155 to 160 in 74856ef
if closer, ok := spanWriter.(io.Closer); ok { | |
err := closer.Close() | |
if err != nil { | |
logger.Error("Failed to close span writer", zap.Error(err)) | |
} | |
} |
Signed-off-by: Juraci Paixão Kröhling [email protected]
Which problem is this PR solving?
Short description of the changes
#Close
. This PR makes the party that creates the span writer responsible for closing it.