fix(storage): destroy local read stream on upload write failure to prevent resource leaks - #8752
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request ensures that the local readStream is properly destroyed if errors occur during the upload or piping process, and adds a corresponding unit test to verify this behavior. The review feedback highlights a potential resource leak if createWriteStream or progress listener attachment throws an error synchronously before the readStream is piped, and suggests instantiating the readStream after the writable stream is set up.
thiyaguk09
marked this pull request as ready for review
June 25, 2026 12:37
Dhriti07
reviewed
Jun 26, 2026
thiyaguk09
force-pushed
the
fix/7325-upload-fd-leak
branch
2 times, most recently
from
July 10, 2026 12:30
8f04997 to
05aba49
Compare
thiyaguk09
force-pushed
the
fix/7325-upload-fd-leak
branch
5 times, most recently
from
July 27, 2026 06:48
0065855 to
292550e
Compare
thiyaguk09
force-pushed
the
fix/7325-upload-fd-leak
branch
7 times, most recently
from
August 4, 2026 06:08
9c3b5d0 to
89a6ab5
Compare
Dhriti07
reviewed
Aug 4, 2026
Dhriti07
reviewed
Aug 4, 2026
Dhriti07
left a comment
Contributor
There was a problem hiding this comment.
LGTM, Will add approval once the linter issue is fixed
thiyaguk09
force-pushed
the
fix/7325-upload-fd-leak
branch
from
August 5, 2026 04:40
89a6ab5 to
1372076
Compare
…event resource leaks
…ream override in tests
…estruction in upload flow
thiyaguk09
force-pushed
the
fix/7325-upload-fd-leak
branch
from
August 5, 2026 06:43
38b85a9 to
94037d4
Compare
Dhriti07
approved these changes
Aug 5, 2026
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.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #7325