RedisConnectionException at each first Connect(), while redis-py and hiredis work fine
Hi Marc,
Version 1.0.289.0 (nuget, .net 4.0).
When I leave my workstation alone for five minutes, after calling Connect() I get a RedisConnectionException the first time. Immediately retrying does work with no delay at a 90% success rate. No info is written to the supplied TextWriter.
var oCli = ConnectionMultiplexer.Connect("srv-flux-01:14144", log);
Complete exception message:
An unhandled exception of type 'StackExchange.Redis.RedisConnectionException' occurred in StackExchange.Redis.dll
Additional information: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail
I connect from Win7 Pro X64 to Redis 2.8.9 (x64) on a Debian machine on our LAN (same subnet). No hardware firewalls in between, only Windows firewall. Redis connections from redis-py or RedisDesktopManager(which uses hiredis) never fail, and always connect within milliseconds.
I use a simple Windows Forms project, VS2013 Express, for testing. I use (and need) the .NET Framework 4 Client Profile.
Any ideas?
Kind regards, TW
@blemasle The same as you said, the issue would not be solved by the retrying.
I've put in some changes that have addressed some connection issues, but I simply do not have a reliable repro scenario to properly investigate here. I can't make it fail in the way you describe. I would love to make it work, but to do that: first I need to see it fail reproducibly.
Is there any detail / context you can add here?
On 20 June 2014 09:02, blemasle [email protected] wrote:
This issue is still reproductible on my side. Any progress on this ? I'm seriously considering finding another library as this prevent headache-less production exploitation....
— Reply to this email directly or view it on GitHub https://github.com/StackExchange/StackExchange.Redis/issues/42#issuecomment-46653995 .
Regards,
Marc
i would say that this issue very similar on #38. I would even say, that root of problem is same. I posted there 50 line program which reproroduce 100% issue. this one https://dl.dropboxusercontent.com/u/27459474/StackExchangeTest2.zip
I do not reproduce the issue on my side with that code. Connection succedded.
Connection fails if you started redis after client.
Nope. I managed to connect, but it took a while. It seems you have a different issue there. In our cases, it seems to fail right away (without any delay) until your kill the app hosting the connection.
ok. i will check with last version, thank you for info
Just confirming that shvez's sample program reproduces the problem.
Hi me to getting same issue with new version .. 1.0.316.0
below is error i am getting .. <--18-07-2014 09:39:20:950 resultStackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail at StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions configuration, TextWriter log) in c:\TeamCity\buildAgent\work\58bc9a6df18a3782\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line 766
code: var configurationOptions = new ConfigurationOptions { EndPoints = { {"xxx.xxx.x.xxxx", 6379} },
//AbortOnConnectFail = false
};
var connectionMultiplexer = ConnectionMultiplexer.Connect(configurationOptions);
IDatabase db = connectionMultiplexer.GetDatabase();
//connection transaction
//ITransaction tran = db.CreateTransaction();
//IBatch batch = db.CreateBatch(true);
Just another shout to say I am experiencing the same issue (with the latest nuget build). On startup of an app (I've only experienced this from a web app so far) SE.Redis will occasionally get stuck at:
StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail
at StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions configuration, TextWriter log)
And won't shift until I touch web.config and restart the app, at which point it works fine. This is with a local development install of redis - so networking issues are fairly unlikely.
I can't reproduce it at will - but I do see it fairly often. Is it worth me capturing a memory dump of the process when its stuck like that for you to have a look at @mgravell or perform any other kind of diagnosis for you?
Cheers.
I just had this happen (recently started using SE.Redis).
3 node cluster (2 web servers, 1 redis server). I could reach the redis server fine from everywhere.
Web server 1 was working fine. Web server 2 could not reach the redis server. A touch of web.config fixed the issue. Also; this was immediately after a deployment that obviously caused the apppool to recycle.
Using NuGet 1.0.322
I imagined this was some race condition during app startup; I tried throwing connections at a server (and also killing them constantly) in a test project but it consistently did re-connect correctly so I couldn't get it stuck in a permanent broken state.
This happened today in the morning when I loaded up my development environment (Redis and website on same machine).
I managed to collect some diagnostic information which is interesting.
The endpoint remains in a DidNotRespond state. I did not have a TextWriter log attached to the endpoint (I do now) so I couldn't get extra trace info as to why it was marked DidNotRespond. I will next time.
I notice that it has a RunId set; yet apparently didn't respond - how would that be possible?
EDIT:
I've also attached the Storm Log at the time that shows connection status. Note that Server 2 is supposed to be unresponsive (I didn't have it running).
Host: PLASMA
PersistentStorage
- Storm Log -
- Status Log - 127.0.0.1:6379: Standalone v2.8.9, master; 16 databases; keep-alive: 00:00:10; int: ConnectedEstablished; sub: ConnectedEstablished, 1 active; not in use: DidNotRespond 127.0.0.1:6379: int ops=15, qu=0, qs=0, qc=0, wr=0, sync=20, socks=2; sub ops=9, qu=0, qs=0, qc=0, wr=0, subs=1, sync=9, socks=1 Circular op-count snapshot; int: 14+1=15 (0.10 ops/s; spans 10s); sub: 8+1=9 (0.10 ops/s; spans 10s) 127.0.0.1:6389: Standalone v2.0.0, master; keep-alive: 00:00:10; int: Connecting; sub: Connecting 127.0.0.1:6389: int ops=0, qu=0, qs=0, qc=0, wr=0, sync=10, socks=50; sub ops=0, qu=0, qs=0, qc=0, wr=0, socks=50 Circular op-count snapshot; int: 0 (0.00 ops/s; spans 10s); sub: 0 (0.00 ops/s; spans 10s) Sync timeouts: 0; fire and forget: 0; last heartbeat: 0s ago
Cache
- Storm Log -
- Status Log - 127.0.0.1:6379: Standalone v2.8.9, master; 16 databases; keep-alive: 00:00:10; int: ConnectedEstablished; sub: ConnectedEstablished, 1 active; not in use: DidNotRespond 127.0.0.1:6379: int ops=15, qu=0, qs=0, qc=0, wr=0, sync=20, socks=2; sub ops=9, qu=0, qs=0, qc=0, wr=0, subs=1, sync=9, socks=1 Circular op-count snapshot; int: 14+1=15 (0.10 ops/s; spans 10s); sub: 8+1=9 (0.10 ops/s; spans 10s) 127.0.0.1:6389: Standalone v2.0.0, master; keep-alive: 00:00:10; int: Connecting; sub: Connecting 127.0.0.1:6389: int ops=0, qu=0, qs=0, qc=0, wr=0, sync=10, socks=50; sub ops=0, qu=0, qs=0, qc=0, wr=0, socks=50 Circular op-count snapshot; int: 0 (0.00 ops/s; spans 10s); sub: 0 (0.00 ops/s; spans 10s) Sync timeouts: 0; fire and forget: 0; last heartbeat: 0s ago
Jobs
- Storm Log -
- Status Log - 127.0.0.1:6379: Standalone v2.8.9, master; 16 databases; keep-alive: 00:00:10; int: ConnectedEstablished; sub: ConnectedEstablished, 1 active; not in use: DidNotRespond 127.0.0.1:6379: int ops=15, qu=0, qs=0, qc=0, wr=0, sync=20, socks=2; sub ops=9, qu=0, qs=0, qc=0, wr=0, subs=1, sync=9, socks=1 Circular op-count snapshot; int: 14+1=15 (0.10 ops/s; spans 10s); sub: 8+1=9 (0.10 ops/s; spans 10s) 127.0.0.1:6389: Standalone v2.0.0, master; keep-alive: 00:00:10; int: Connecting; sub: Connecting 127.0.0.1:6389: int ops=0, qu=0, qs=0, qc=0, wr=0, sync=10, socks=50; sub ops=0, qu=0, qs=0, qc=0, wr=0, socks=50 Circular op-count snapshot; int: 0 (0.00 ops/s; spans 10s); sub: 0 (0.00 ops/s; spans 10s) Sync timeouts: 0; fire and forget: 0; last heartbeat: 0s ago
Just to pile-on and say I am experiencing the same issue. In my case, our application consists of Redis installed as a windows service, three other windows services, and an ASP.NET MVC web application. All running on the same machine, and all communicate through Redis in various ways. What I am finding since I switched from BookSleeve to StackExchange.Redis a few days ago is that during installation, my services take an extraordinary amount of time to start up, apparently because they are taking quite a long time to attempt to connect to the Redis service. Sometimes they succeed and some times they fail to connect. I see the same exception message noted by other posters above. When they fail, I can sometimes get them to connect by restarting the service. I would say the failure rate is greater than 50% in my case. This is happening on both server 2008 R2 as well as 2012 R2.
For now I am forced to switch back to BookSleeve (which never failed me) since our software is entering Beta testing and reliability is a must. I am hoping this gets resolved soon.
I am using version 1.0.322 which I pulled with NuGet just a few days ago.
Adding to this as well since we just had this occur last night for the first time. We have two applications running on the same machine (Windows Server 2008 R2) both using the same version of StackExchange.Redis (version 1.0.273, yes not the latest version). The WCF Service application had no problems but our Web API application bombed last night trying to connect to our Redis server right after IIS performed the 29 hour recycle on the WebAPI application.
That's the exact same case we have @Raven87. What I found until now is to kill the w3wp process and bring it to life again.
Until now, i've never been able to reproduce the issue on a standalone app, but I keep trying to reproduce the issue at a 100% rate as this is becoming more and more problematic...
@Plasma, @Raven87, @blemasle i ask just to be sure. are you talking about last version build 322 or higher?
@shvez Yes I updated to the latest version yesterday or the day before, can't remember.
@blemasle thank you
K; I need to read through a lot of "chain" and try to understand what is going on here...
On 6 August 2014 13:53, Ilya Shvetsov [email protected] wrote:
@blemasle https://github.com/blemasle thank you
— Reply to this email directly or view it on GitHub https://github.com/StackExchange/StackExchange.Redis/issues/42#issuecomment-51329903 .
Regards,
Marc