-
Notifications
You must be signed in to change notification settings - Fork 395
Open
Labels
api: storageIssues related to the googleapis/nodejs-storage API.Issues related to the googleapis/nodejs-storage API.
Description
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
A screenshot that you have tested with "Try this API".
N/A, the bug is in the client code.
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://gist.github.com/MartinKolarik/04bcb1ac4209d3afee62a31667f666d7
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
- Create a large local file.
- Start
bucket.upload. - Force an early failure (e.g., upload to a bucket without write permissions).
- Delete the local file while the process is alive.
- Check
/proc/<pid>/fdanddf/du.
A clear and concise description of what the bug is, and what you expected to happen.
The file descriptor open in bucket.upload remains allocated until the process exists. This causes a small memory leak and prevents the local file from being fully deleted. The relevant code is:
Lines 4364 to 4379 in c7004da
| fs.createReadStream(pathString) | |
| .on('error', bail) | |
| .pipe(writable) | |
| .on('error', err => { | |
| if ( | |
| this.storage.retryOptions.autoRetry && | |
| this.storage.retryOptions.retryableErrorFn!(err) | |
| ) { | |
| return reject(err); | |
| } else { | |
| return bail(err); | |
| } | |
| }) | |
| .on('finish', () => { | |
| return resolve(); | |
| }); |
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
The file descriptor should always be closed when the function finishes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the googleapis/nodejs-storage API.Issues related to the googleapis/nodejs-storage API.