bigdata4u / spymemcached

Automatically exported from code.google.com/p/spymemcached
0 stars 0 forks source link

Possible resource leak in MemcachedClient.shutdown() #239

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What version of the product are you using? On what operating system?
2.8.0

Tell me more...
      try {
        mconn.setName(baseName + " - SHUTTING DOWN (telling client)");
        mconn.shutdown();
        mconn.setName(baseName + " - SHUTTING DOWN (informed client)");
        tcService.shutdown();
      } catch (IOException e) {
        getLogger().warn("exception while shutting down", e);
      }

mconn.shutdown() calls selector.close() which potentially can throw 
IOException. That exception will prevent tcService.shutdown() from being 
called. So the underlying ThreadPoolExecutor will not be shutted down (unless 
thread pool is created with daemon threads which is not always the case) and 
this will produce a memory leak in a web application on hot redeploy. Also this 
can prevent regular Java application from terminating.

Original issue reported on code.google.com by Ash2kk@gmail.com on 28 Feb 2012 at 12:27

GoogleCodeExporter commented 8 years ago
Ops, this already was reported in issue 228 (though against 2.7.3).

Original comment by Ash2kk@gmail.com on 29 Feb 2012 at 3:41

GoogleCodeExporter commented 8 years ago

Original comment by ingen...@gmail.com on 16 Mar 2012 at 5:05