sebpiq / rhizome

Web server for participative art performances and installations.
GNU General Public License v3.0
164 stars 13 forks source link

Bug with websockets #117

Closed sebpiq closed 8 years ago

sebpiq commented 8 years ago

web socket not opened, send failed : Error: not opened events.js:85 throw er; // Unhandled 'error' event ^ Error: zlib binding closed at DeflateRaw.Zlib._transform (zlib.js:487:15) at DeflateRaw.Transform._read (_stream_transform.js:179:10) at DeflateRaw.Transform._write (_stream_transform.js:167:12) at doWrite (_stream_writable.js:301:12) at clearBuffer (_stream_writable.js:411:7) at onwrite (_stream_writable.js:344:7) at WritableState.onwrite (_stream_writable.js:105:5) at afterTransform (_stream_transform.js:99:5) at TransformState.afterTransform (_stream_transform.js:74:12) at Zlib.callback (zlib.js:611:5)

sebpiq commented 8 years ago

This was a node-ws bug. Upgrading to newest node-ws should fix that : https://github.com/websockets/ws/pull/632

kirbysayshi commented 8 years ago

This might be the same bug, not sure. This happened during the performance last night, killed the entire websocket server:

Mon, 02 May 2016 03:34:44 GMT rhizome.server.websocket Connection(websockets:hb43yDtNw2eUcKSY) opened - total connections 40
Mon, 02 May 2016 03:34:44 GMT synae-server:http [5401]: (::ffff:172.16.0.27) GET => /bundle.css
Mon, 02 May 2016 03:34:44 GMT synae-server:http [5400]: (::ffff:172.16.0.27) GET => /bundle.js
Mon, 02 May 2016 03:34:44 GMT rhizome.server.connections send /broadcast/open/websockets [hb43yDtNw2eUcKSY]
/Users/drewp/Dropbox/js/synae-server/node_modules/ws/lib/WebSocket.js:218
    else throw new Error('not opened');
         ^

Error: not opened
    at WebSocket.send (/Users/drewp/Dropbox/js/synae-server/node_modules/ws/lib/WebSocket.js:218:16)
    at _onceConnectionOpen (/Users/drewp/Dropbox/js/synae-server/node_modules/rhizome-server/lib/websockets/Server.js:120:16)
    at g (events.js:286:16)
    at emitNone (events.js:91:20)
    at emit (events.js:185:7)
    at /Users/drewp/Dropbox/js/synae-server/node_modules/rhizome-server/lib/core/server.js:112:12
    at /Users/drewp/Dropbox/js/synae-server/node_modules/rhizome-server/node_modules/async/lib/async.js:726:13
    at /Users/drewp/Dropbox/js/synae-server/node_modules/rhizome-server/node_modules/async/lib/async.js:52:16
    at /Users/drewp/Dropbox/js/synae-server/node_modules/rhizome-server/node_modules/async/lib/async.js:269:32
    at /Users/drewp/Dropbox/js/synae-server/node_modules/rhizome-server/node_modules/async/lib/async.js:44:16

(node 6)

sebpiq commented 8 years ago

no ... that's a different one. Did you have something to restart the server automatically? Did the performance work overall anyways?

sebpiq commented 8 years ago

@kirbysayshi : opened new ticket for this #119

kirbysayshi commented 8 years ago

unfortunately, this exposed a bug in the cluster logic! I use forever, but with the cluster module when a worker dies it doesn't bring down the whole parent process, just that one worker. And I forgot to respawn new workers in the event of a dead worker (https://github.com/kirbysayshi/synae-server/blob/master/master.js#L22).

Luckily it happened towards the end of the performance and so wasn't a complete failure

sebpiq commented 8 years ago

ah dammit ... ok this should be easy to fix anyways. I'll fix these 2 bugs at once and make a new release.

kirbysayshi commented 8 years ago

That would be amazing! I definitely need to fix the cluster stuff too of course, since if I'd thought through that it wouldn't have been an issue.