Bug 56790 - Resizing pool.maxActive to a higher value at runtime leads to unmanaged connections
Summary: Resizing pool.maxActive to a higher value at runtime leads to unmanaged conne...
Status: NEW
Alias: None
Product: Tomcat Modules
Classification: Unclassified
Component: jdbc-pool (show other bugs)
Version: unspecified
Hardware: PC Mac OS X 10.4
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2014-07-29 21:34 UTC by Bertrand Renuart
Modified: 2014-07-30 20:57 UTC (History)
1 user (show)

Testcase (2.60 KB, text/plain)
2014-07-30 20:57 UTC, Bertrand Renuart

Note You need to log in before you can comment on or make changes to this bug.
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 will fail at the two Asserts. Comment the first to get up to the second.