Bug 56790

Summary: Resizing pool.maxActive to a higher value at runtime leads to unmanaged connections
Product: Tomcat Modules Reporter: Bertrand Renuart <brenuart>
Component: jdbc-poolAssignee: Tomcat Developers Mailing List <dev>
Status: NEW ---    
Severity: normal CC: brenuart
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X 10.4   
Attachments: Testcase

Description Bertrand Renuart 2014-07-29 21:34:26 UTC
Resizing maxActive to a higher value on a live pool leads to untraceable/unmanaged connections.

The pool accepts the new higher value and accepts to deliver new connections but the following warning message is logged:
"Connection doesn't fit into busy array, connection will not be traceable."

When looking at the code it appears the ArrayBlockingQueue holding the busy connections is not resized and keeps its original size: the extra connections cannot be added to it.

The main consequence is the pool size isn't actually increased. Connections created past the original maxActive limit will never be pooled but immediately dropped once closed by the application.


I made a small unit test to illustrate the case - should I post it somewhere?
Comment 1 Filip Hanik 2014-07-30 02:47:55 UTC
attach unit test here
Comment 2 Bertrand Renuart 2014-07-30 20:57:39 UTC
Created attachment 31860 [details]
Testcase

TestCase will fail at the two Asserts. Comment the first to get up to the second.