Weird error on socket.io garbage collector

413 views
Skip to first unread message

Sergio Canales

unread,
Jan 7, 2013, 5:24:18 PM1/7/13
to sock...@googlegroups.com
Hi all,

Has anyone encountered this error:

TypeError: Cannot use 'in' operator to search for 'issued' in null
at String.IN (native)
at Manager.garbageCollection (/node_modules/socket.io/lib/manager.js:1021:21)
at Timer. (native)
at Timer.ontimeout (timers.js:223:14)

It seems to be something related to the handshake that is cleaned up on the GarbageCollector method on manager.js file.

Here is a link to the pull request for this GC method (https://github.com/LearnBoost/socket.io/pull/408), can anyone tell me anything about this?

I've done a temporary fix by checking for null on that if condition, but something tells me there's something wrong going on somewhere else.

Thanks,

Sergio

Lassi Kinnunen

unread,
Feb 14, 2013, 6:43:16 AM2/14/13
to sock...@googlegroups.com
earlier in the autumn it at least proved very tricky for us to get the built in redis clustering to work reliably so that the socket.io instances would stay in sync(it would leak rooms, sometimes).

our fix was to use redis-pub sub instead of rooms, while waiting for proper cluster support for socket.io. redis pubsub is fairly simple and ended up being almost as much/little code as doing it via the socket.io provided redis support and this has provided us with crash/leak free environment running for several months.


-lassi



On Monday, January 28, 2013 10:11:48 PM UTC+2, la...@iamat.com wrote:
Hi,

I am seeing here exactly the same problem.

Our setup:
- 4 servers with node.js, socket.io and redis-store
- ELB with tcp forwarding
- slightly higher load (especially xhr-polling) because we got mentioned in Argentinian TV

The behaviour seems a bit random and it's difficult to reproduce. But starting 8-12 servers and connecting with some xhr-polling clients reproduces the exceptions reliable. Our hypothesis until now is that the high concurrency of servers corrupt somehow the manager.handshaken object.

Some more observations which might be helpful:
- I see pretty much every time discrepancies between sockets.clients() output of the different servers. Shouldn't it be that they return the same in all servers?
-  Sometimes we not only get the error: "Cannot use 'in' operator to search for 'issued' in null" but also "Cannot use 'in' operator to search for 'issued' in undefined". The undefined here is pretty strange, looking at the code I can't find any reason why handshaken should be undefined.

We have really issues scaling our app and hoped on the redis backend but it seems that this won't work. Any ideas if there is any chance to fix the redis-store any time soon? Or is it that we do something fundamentally wrong?

Bests,
Lars
Reply all
Reply to author
Forward
0 new messages