title: How does ConnectionMultiplexer deal with disconnects?
body: <p>The <a href="https://github.com/StackExchange/StackExchange.Redis/blob/master/Docs/Basics.md" rel="noreferrer">Basic Usage</a> documentation for StackExchange.Redis explains that the <code>ConnectionMultiplexer</code> is long-lived and is expected to be reused.</p>
  
  <p>But what about when the connection to the server is broken? Does <code>ConnectionMultiplexer</code> automatically reconnect, or is it necessary to write code as in <a href="https://stackoverflow.com/a/25946747/983064">this answer</a> (quoting that answer):</p>
  
  <pre><code>        if (RedisConnection == null || !RedisConnection.IsConnected)
          {
              RedisConnection = ConnectionMultiplexer.Connect(...);
          }
          RedisCacheDb = RedisConnection.GetDatabase();
  </code></pre>
  
  <p>Is the above code something good to handle recovery from disconnects, or would it actually result in multiple <code>ConnectionMultiplexer</code> instances? Along the same lines, how should the <code>IsConnected</code> property be interpreted?</p>
  
  <p><em>[Aside: I believe the above code is a pretty bad form of lazy initialization, particularly in multithreaded environments - see <a href="http://csharpindepth.com/articles/general/singleton.aspx" rel="noreferrer">Jon Skeet's article on Singletons</a>].</em></p>