Fix file descriptor leak in FileIO instrumentation - #2248
Merged
adinauer merged 5 commits intoSep 19, 2022
Conversation
ntoskrnl
requested review from
adinauer,
romtsn and
stefanosiano
as code owners
September 17, 2022 20:36
adinauer
approved these changes
Sep 19, 2022
adinauer
left a comment
Member
There was a problem hiding this comment.
LGTM. Thank you very much for fixing this bug!
marandaneto
reviewed
Sep 19, 2022
marandaneto
reviewed
Sep 19, 2022
…InputStream.java Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com>
…OutputStream.java Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com>
Codecov ReportBase: 80.64% // Head: 80.62% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2248 +/- ##
============================================
- Coverage 80.64% 80.62% -0.03%
- Complexity 3366 3368 +2
============================================
Files 240 240
Lines 12382 12388 +6
Branches 1646 1646
============================================
+ Hits 9986 9988 +2
- Misses 1787 1791 +4
Partials 609 609
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
There is a bug in FileIO tracing that causes leak in file descriptors.
The bug affects Android and Java.
💡 Motivation and Context
The context and all the information is here.
When we create
new SentryFileInputStream(file)ornew SentryFileOutputStream(file), 2 file descriptors are opened. But when we close the stream, only one is closed. The cause is in this comment.💚 How did you test it?
Run the code below in the sample app. Before fix I see lsof still shows 10 open files even though they are closed. After fix - nothing shows up.
📝 Checklist