Skip to content

fix(storage): destroy local read stream on upload write failure to prevent resource leaks#25

Open
thiyaguk09 wants to merge 12 commits into
mainfrom
fix/7325-upload-fd-leak
Open

fix(storage): destroy local read stream on upload write failure to prevent resource leaks#25
thiyaguk09 wants to merge 12 commits into
mainfrom
fix/7325-upload-fd-leak

Conversation

@thiyaguk09

Copy link
Copy Markdown
Owner

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:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the bucket upload logic to ensure that the local read stream is explicitly destroyed if a read or write error occurs, and adds a corresponding unit test to verify this behavior. The review feedback suggests destroying the writable stream on read errors to prevent resource leaks, asserting that the read stream is defined in the test before checking its destroyed state, and resetting the mock override in an afterEach hook to avoid test pollution.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread handwritten/storage/src/bucket.ts
Comment thread handwritten/storage/test/bucket.ts
Comment thread handwritten/storage/test/bucket.ts
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.

2 participants