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

Close the span writer on main #2096

Merged
merged 2 commits into from
Feb 27, 2020
Merged

Close the span writer on main #2096

merged 2 commits into from
Feb 27, 2020

Conversation

jpkrohling
Copy link
Contributor

Signed-off-by: Juraci Paixão Kröhling [email protected]

Which problem is this PR solving?

Short description of the changes

  • Previously, the span writer was being closed twice when the all-in-one was being used: once from the all-in-one main, and one from the collector's #Close. This PR makes the party that creates the span writer responsible for closing it.

@jpkrohling jpkrohling requested a review from a team as a code owner February 27, 2020 16:24
@codecov
Copy link

codecov bot commented Feb 27, 2020

Codecov Report

Merging #2096 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
plugin/storage/cassandra/spanstore/writer.go 100% <100%> (ø) ⬆️
...lugin/sampling/strategystore/adaptive/processor.go 100% <0%> (+0.79%) ⬆️

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 7127d0e...7fa415d. Read the comment docs.

if err != nil {
logger.Error("failed to close span writer", zap.Error(err))
}
}
Copy link
Member

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?

Copy link
Contributor Author

@jpkrohling jpkrohling Feb 27, 2020

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:

if closer, ok := spanWriter.(io.Closer); ok {
err := closer.Close()
if err != nil {
logger.Error("Failed to close span writer", zap.Error(err))
}
}

@yurishkuro yurishkuro merged commit 913ab1c into jaegertracing:master Feb 27, 2020
@jpkrohling jpkrohling deleted the Close-spanwriter-on-main branch July 28, 2021 19:22
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.

Panic on close of closed channel
2 participants