|Weird error on socket.io garbage collector||Sergio Canales||1/7/13 2:24 PM|
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.
|Re: Weird error on socket.io garbage collector||Lars Jacob||1/28/13 12:11 PM|
I am seeing here exactly the same problem.
- 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?
|Re: Weird error on socket.io garbage collector||Lassi Kinnunen||2/14/13 3:43 AM|
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.