Some more information.... I setup my service to periodically print the admin pools active and idle connections. The hang problem happens after a successful redeploy, but the web server stops processing requests and the log generally shows 16 active connections. Is there a timeout check for active connections? I did notice it is using an old (1.6) version of commons pool, any reason this hasn't been upgraded?
I also did some tests where I shutdown openldap while making requests. Everything seems to recover when I start it back up, but the active connections only ever show a negative number after, so not sure what to make of that. ----- Original Message ----- From: "Chris Pike" <[email protected]> To: [email protected] Sent: Friday, March 4, 2016 11:06:28 AM Subject: Re: LDAP Connection Management I've been playing around with closing the connection pools... I added this into ApacheDsDataProvider and call it when the war shuts down, however it doesn't solve the problem. Is this the correct location and way to close the pools? public static void closeAllConnectionPools(){ try { LOG.info("Admin pool active: " + adminPool.getNumActive()); LOG.info("Admin pool idle: " + adminPool.getNumIdle()); adminPool.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } try { LOG.info("User pool active: " + userPool.getNumActive()); LOG.info("User pool idle: " + userPool.getNumIdle()); userPool.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } try { LOG.info("Log pool active: " + logPool.getNumActive()); LOG.info("Log pool idle: " + logPool.getNumIdle()); logPool.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } ----- Original Message ----- From: "Shawn McKinney" <[email protected]> To: [email protected] Sent: Friday, March 4, 2016 10:14:59 AM Subject: Re: LDAP Connection Management > On Mar 3, 2016, at 9:27 PM, Kiran Ayyagari <[email protected]> wrote: > > my guess is that there is a connection pool in use here, and it is not > properly destroyed while the app > is being unloaded from the app server. > > Did you try closing the pool in your app's ServletContextListener? Kiran, thanks for jumping in here. Short answer is no we’re not capturing termination events and properly destroying the pool. Shouldn’t be a hard to do, but we’ll prolly have to open an api to the client as the pool isn’t currently accessible - publicly. Shawn
