-
Notifications
You must be signed in to change notification settings - Fork 37
NodeJs v8 stream.push() after EOF #60
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Confirmed. I get this issue with Node v8 as well. |
Anyone taking this? Can someone point me to where I should look? |
Notice node 8.1 fixes something in zlib. Is this related?
|
This still occurs in Node v8.1.0. |
Same issue, v8.0.0 |
@jonathanong could you please take a look? |
i've seen this before. i haven't investigated it yet. it is one of the blockers for me to upgrading to node 8. |
anyone found a fix for this? also, is there an alternative middleware? |
In my case, i found solution by changing order of compress and conditional-get middleware
|
is it because you are using |
e50d15f seems okay to me. anyone else have any ideas? |
@jonathanong without flush parameter i have same result but if koa-compress middleware over conditional-get middleware everything okay. Looks like this issue happening only when we use conditional-get middleware. |
okay, i think the time i saw this error was with |
It seems 8.1.2 fixes it. Any idea what causes this in the first place? |
Still experiencing this in 8.1.2. I don't have |
I have same issue in 8.1.2 but with conditional-get middleware. I see this issue once more when my stream was broken. |
can anyone make a PR with a failing test casE? |
Can you check if nodejs/node#13850 this solves the issue? |
Node 8.1.3 fixes the issue. |
8.1.3 works for me as well |
closing. thanks @mcollina ! |
node v8.1.3 still same issue
Don't forget to include test css with some content to public dir |
I don't use conditional get or etag and still see this issue (with node 8.1.3 and even using Z_SYNC_FLUSH). I'm using koa-webpack middleware though. |
I'll be happy to have a look, if you can post an example to reproduce the issue consistently. |
@mcollina you can try my example only install deps and run this app then visit page and reload it! After reloading you can see this message in your console
|
Could the OS be a factor? I'm on Windows 7 x64. Even in my setup, I don't get it consistently. E.g., I ran my app right now and there were no errors. Then I refreshed the page and saw this error. And sometimes it happens many times within the same request. I'll try to upload my setup tonight. |
@mcollina i am also on Mac Os 10.11 |
https://github.com/Eldar-X/koa-issue my simple setup |
Confirmed, this is still happening. Quite interestly enough, this does not happen with CURL. I'll see if I can track this down (it might take a while). It seems a different one than nodejs/node#13850. |
Now I cannot reproduce anymore. However, the same node version/code was showing the problem while I was traveling (and I could not work on it). If someone has a consistent way of reproducing this problem, please let me know. |
I can reproduce by loading the server with autocannon:
|
If the stream is destroyed while the transform is still being applied, push() should not be called, and the internal state should be cleared. See: koajs/compress#60
Here is the fix: nodejs/node#14330 |
If the stream is destroyed while the transform is still being applied, push() should not be called, and the internal state should be cleared. See: koajs/compress#60 PR-URL: #14330 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Will you be adding a regression test for this? Then maybe apply for addition to node's CitGM |
If the stream is destroyed while the transform is still being applied, push() should not be called, and the internal state should be cleared. Refs: koajs/compress#60 PR-URL: nodejs#14330 Backport-PR-URL: nodejs#14396 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Conflicts: lib/zlib.js
This should be definitely fixed in Node 8.2.1. |
@jonathanong if you could write a regression test for this. It's literally keeping up at night 😨 |
@refack im not sure what the test case is... |
@jonathanong this might help https://github.com/nodejs/node/pull/14330/files 🤷♂️ |
I have it on 8.10.0 on windows |
@dominictobias can you please confirm that #60 (comment) can be used to reproduce the problem? |
Ah don't worry, I speed read on a number of issues and this is a general problem with npm cache and windows, rather than something koa specific 😳 |
npm cache clean --force |
In my case, after making a |
After upgrade to v8 i got error in console
Error: stream.push() after EOF at readableAddChunk (_stream_readable.js:227:30) at Gzip.Readable.push (_stream_readable.js:195:10) at Gzip.Transform.push (_stream_transform.js:151:32) at Zlib.callback (zlib.js:430:16)
The text was updated successfully, but these errors were encountered: