title: Sharded Jedis - When should I call pool.destroy()?
body: <p>I'm helping maintain an app that uses Jedis to connect to Sharded Redis.</p>
  
  <p>The app I'm working with keeps an instance of the <strong>ShardedJedisPool</strong> in a service, to keep reusing it over multiple requests.</p>
  
  <p>I was <a href="https://github.com/xetorthio/jedis/wiki/AdvancedUsage#wiki-shardedjedis" rel="nofollow">reviewing the docs on Sharded Jedis</a> and <a href="https://github.com/xetorthio/jedis/wiki/AdvancedUsage#wiki-3-disconnect--returnressource" rel="nofollow">noticed the following comment</a>:</p>
  
  <blockquote>
    <p>Forgetting pool.destroy keeps the connection open until timeout is
    reached.</p>
  </blockquote>
  
  <p>Our app isn't calling <strong>pool.destroy()</strong> anywhere. Should we be calling <strong>pool.destroy()</strong> on every request? And I guess, creating a new pool on every request as well? Or can my pool stay alive for the lifetime of my service, and only call <strong>pool.destroy()</strong> in the <strong>finalize</strong> method of the service?</p>