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

Fix memory leaks on interrupted upload #188

Merged
merged 6 commits into from Mar 2, 2022
Merged

Conversation

mitjap
Copy link
Collaborator

@mitjap mitjap commented Jun 9, 2021

When connection is closed by client (for example when pausing an upload), promise is never settled, which causes memory leak. This issue is present in FileStore and GCSDataStore (not sure about S3Store). In case of FileStore files might stay in write mode and locked.

When using .pipe() not all events are connected, so I switched it to new stream.pipeline(source, destination, cb).

This was inspired by #34.

@Acconut
Copy link
Member

Acconut commented Jul 9, 2021

Nice catch! i didn´t know stream.pipe could be dangerous and that there is a stream.pipeline method to work around this.

@ErunamoJAZZ
Copy link

oh god, this would explain those memory leaks I got in a project sometime ago :S

@Murderlon Murderlon added this to On Deck in Release 1.0.0 Jan 31, 2022
Copy link
Member

@Murderlon Murderlon left a comment

Choose a reason for hiding this comment

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

Needs a merge from master but other than that this seems good to go

@Murderlon Murderlon merged commit 2153b17 into master Mar 2, 2022
@Murderlon Murderlon deleted the fix-closed-connection branch March 2, 2022 05:57
@Murderlon
Copy link
Member

Thanks!

@mitjap mitjap moved this from On Deck to Done in Release 1.0.0 Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants