1

I attempt to connect to my Redis Serverinstance through ConnectionMultiplexer.Connect("127.0.0.1"); but despite no server being up and running the connect does not throw an error nor raise any ConnectionFailed event. I double checked I do not have any stand-alone instance nor Windows Service of Redis running.

How can I check whether a connect was successful or not? I run on .Net 4.5 and use StackExchange.Redis version 4.0.30319

Thanks

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
Matt
  • 7,004
  • 11
  • 71
  • 117

1 Answers1

3

That should probably be logged as a bug on SE.Redis rather than as a question here. It is not meant to do that unless you have have explicitly set AbortOnConnectFail to false (it defaults to true).

As for how to detect it if a glitch exists:

  • try a Ping()
  • use the IsConnected property on IServer
  • use the IsConnected(RedisKey) method on IDatabase (if you aren't using a cluster, you can pass default(RedisKey) to that method; on a cluster it is necessary to know which server you are talking about)
Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • The server is not connected per IsConnected property. Is it intended behavior to not reflect the failure to connect upon calling `ConnectionMultiplexer.Connect(endPointAddress)`? If not would you know when a fix makes it into the next release and when to expect the next release? Thanks – Matt Apr 01 '14 at 13:36
  • @MattWolf yes, it is *intended* that `Connect`/`ConnectAsync` would fail if it cannot connect, *unless* you have disabled `AbortOnConnectFail`; I have a repro - will look later today – Marc Gravell Apr 01 '14 at 13:42
  • @MattWolf this is now pushed in 1.0.241 – Marc Gravell Apr 01 '14 at 19:07
  • @MarcGravell, can you please check related to redis http://stackoverflow.com/questions/24531421/remove-delete-all-one-item-from-stackexchange-redis-cache – Imran Qadir Baksh - Baloch Jul 02 '14 at 12:45