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

No write event emiter #9

Closed
nikonhub opened this issue May 1, 2019 · 3 comments
Closed

No write event emiter #9

nikonhub opened this issue May 1, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@nikonhub
Copy link

nikonhub commented May 1, 2019

When unread === 0 we add listeners on write and finish events.
But it seems the write event is never emited.

So the problem I have is when my writeStream has no more to read because the upload is too slow it waits to the finish event (full upload) before restart writing.

image

Do you think it should be added manually. Because I can not find a write event in nodejs doc.

image

@mike-marcacci
Copy link
Owner

Thanks so much for the detailed investigation! I am slammed today but I’ll look into this tomorrow. Keep posting if you learn anything more!

@mike-marcacci mike-marcacci added the bug Something isn't working label May 1, 2019
@nikonhub
Copy link
Author

nikonhub commented May 2, 2019

No hurry :).
I don't think I can dig more than this solution. It seems we should manually call emit on write event when a _write occurs.

I ran your tests and all passes. In my case it fix the problem but I can not foresee all cases when it could misbehave.

@mike-marcacci
Copy link
Owner

Thanks so much for the investigation @nikosmonaut! It looks like I inadvertently removed the event in this commit and didn't have tests to protect against this kind of timing bug.

The correct behavior has been restored (along with some new tests) and is published as a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants