SynchroLabs / SynchroServer

The Synchro Server platform
https://synchro.io
1 stars 2 forks source link

Redis session manager robustification #23

Closed BobDickinson closed 8 years ago

BobDickinson commented 10 years ago

It looks like Redis will be the session state manager of choice. To access Redis we use the node_redis project hosted here (this is apparently the "officially recommended" library):

https://github.com/mranney/node_redis

I have run in to a number of issues with this library, and the responses from the maintainer and primary contributor do not fill me with confidence (that either the issues will be addressed, or that the underlying code was reasonably designed and implemented in the first place).

Here is one example, having to do with Azure's Redis terminating connections in a not-cool way:

https://github.com/mranney/node_redis/issues/628

And here's the Azure forum version of that complaint:

http://social.msdn.microsoft.com/Forums/windowsazure/en-US/7ce3e7bd-e72d-411b-b6e7-960bc42525f1/azure-redis-connection-timeout-behavior-problematic?forum=azurecache

Aside from that fairly specific issue (which is addressed by the "ping" hack, and may have been fixed by Azure by now), there is a bunch of creepiness (IMO) related to connection management, retry logic, etc. (both expressed in that bug and others). For example, check this out:

https://github.com/mranney/node_redis/issues/601

What we need is some support in our Redis session manager for dealing with sessions that fail (disconnect, timeout, go away, whatever) such that our session logic will succeed when possible, and will avoid very long delays when possible (I don't need a two minute socket timeout to know that a Redis transaction failed). We may also want to look in to connection pooling.

But the bottom line is that right now, this is not shippable (case in point, Azure Redis went down for a few minutes and came back up, and the Azure-hosted Synchro API server never recovered).

BobDickinson commented 8 years ago

All of this stuff was super obsolete. New Redis module is a ton better (addressed the issues, has CI tests now, just generally a lot better).

Even with the old Redis module, we'd had servers run 3+ months on Azure with no Redis issues (after Azure cleaned up their end).