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

WIP: Fix deadlock happens if a big file is uploaded #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mie00
Copy link

@mie00 mie00 commented Oct 20, 2017

in the write stream, the stream uncork happens before the actual write method ends, and so the data doesn't get written completely. When this happen, the drain event doesn't get fired and so who ever writes to the stream waits indefnitely for the drain event.
The fix was to move the uncork, cork calls to the callback of the stream.write method

@mie00 mie00 changed the title Fix deadlock happens if a big file is uploaded WIP: Fix deadlock happens if a big file is uploaded Oct 20, 2017
@mie00 mie00 force-pushed the patch-1 branch 5 times, most recently from ba62e24 to 58642a8 Compare October 20, 2017 22:48
in the write stream, the stream uncork happens before the actual write method ends, and so the data doesn't get written completely. When this happen, the drain event doesn't get fired and so who ever writes to the stream waits indefnitely for the drain event.
The fix was to move the uncork, cork calls to the callback of the stream.write method
@ablaszkiewicz
Copy link

This pr is underrated. Proper drain event is very important when dealing with write streams.

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