Problem serving client on Node 0.8 #932

Closed
JonnyBGod opened this Issue Jun 28, 2012 · 16 comments

Comments

Projects
None yet

I am getting some weird behavior after updating to Node 0.8 and updating socket.io to use redis 7.2.

Around 90% of the times I refresh my client I am getting and empty socket.io-client.js file with 200 response head.

Other 10% of the times everything is fine...

Tivoli commented Jun 28, 2012

I'm having the same issue, but I'll get a partial file.

Tenzer commented Jun 29, 2012

Are you using gzip compression? When I disable gzip compression it seems to work fine, compared to when that's enabled, then where I just get an empty file.

denisu commented Jun 30, 2012

Same here, disabling the gzip compression fixes it.

+1, I am having this problem as well.

vadimi commented Jul 2, 2012

The same here when using gzip compression. I just did some debugging. Socket.io spawns gzip process and serves content on exit event. On my machine this 'exit' event fires earlier that 'data' event of stdout which leads to 0 content-length.

maritz commented Jul 8, 2012

+1, me too.

itsatony commented Jul 9, 2012

+1, me too. strangely it was browser-dependent... firefox worked, chrome didnt..

wavded commented Jul 9, 2012

Turning off gzip compression fixed it for me

vadimi commented Jul 9, 2012

According to nodejs API changes between v0.6 and v0.8 there is a significant change in child_process module that is used to spawn gzip process for js file compression.

  • the exit event is now emitted right after the child process exits. It no longer waits for all stdio pipes to be closed.
  • the close event was added that has is emitted after the child has exited and all the stdio pipes are closed:

Socket.io sends the compressed content in exit event (lib/static.js#L181). When I switch exit to close event everything works fine again.

phoenixz commented Jul 9, 2012

+1 Same here.. Since many libraries have node 0.8 support, and 0.8 is a lot more stable than 0.6, and it makes socket.io unusable on 0.8 (until you finally find out about the gzip thing), it may be quite an important issue to fix.. Or at least document on your main page where somebody can find it..

Contributor

rauchg commented Jul 9, 2012

Good point. I think I'll probably make gzip compression a noop.

guille: is there a reason it's spawning gzip instead of using the built in zlib support? (documented here: http://nodejs.org/docs/v0.6.19/api/zlib.html)

Contributor

rauchg commented Jul 31, 2012

We need to update to zlib for sure. But for 1.0 I'm switching the whole asset delivery to "connect-static" to make the codebase leaner. So it's not a concern at the moment.

adrai commented Jul 1, 2013

@guille any plan when this gzip issue (for windows) will be solved? At the moment there is no way to use socket.io in production (with gzip) on windows :-(

Tenzer commented Jul 3, 2013

This issue should probably be closed, as the original issue was fixed almost a year ago.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment