-
Notifications
You must be signed in to change notification settings - Fork 281
Add support for starting without requiring redis server being available #44
Comments
I had a similar problem a while ago, although I'm not using poolboy. I think the main issue is that eredis has inconsistent default reconnect behavior. On the initial connection it won't retry, but after a dropped connection it will. Because the initial connection happens during the gen_server init callback, which is synchronous, it can't reconnect. Ideally the initial connect should be moved out of the init callback, but doing that could theoretically cause issues for existing clients. So what I did instead was add the ability to specify that eredis should not reconnect automatically in any case (using no_reconnect as the reconnect timeout). In my usage I have a process wrapping the eredis client that handles the reconnect. That makes the initial connect consistent with subsequent reconnects. Also avoids the reconnect process in eredis, which is not supervised or linked. It would be good to have more robust code in eredis itself if you are up for making the changes. I'd like to see the following:
|
I'm up for accepting (and reviewing) such a patch. The behaviour needs to be configurable: crash on start if Redis unavailable or start, but try to reconnect (taking into account no_reconnect). |
Someone already had this covered, partially: https://github.com/layerhq/eredis/commit/cbcb729ecd9f4b17b7e2b3c68d08a852fa7dd358 |
Fixed by #105. Please close this issue. |
I have a slightly larger application. Redis (and eredis) are in no way essential for its functionality. Only "good to have sometimes".
If I shut down redis after starting my application, I'm totally fine now. Eredis (via poolboy) gets reconnected when and if redis comes back up.
But I can't seem to be able to start my applications without having redis up. Poolboy/eredis crashes and brings down my app that spawns it. I could flag that pool as transient, but that means it will never start again if redis becomes available.
So, do you think it's a good idea modify eredis in a way that it's able to start, and connect to redis later if at all?
I am willing to do the required changes myself, if there is a will for them being accepted, and after we have an understanding what to change exactly.
So what do you guys think?
The text was updated successfully, but these errors were encountered: