Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003837 [Resin] minor always 01-05-10 15:00 01-07-10 10:00
Reporter alex View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.1.9
Summary 0003837: DBPool does not wait for connections according to logic specified by <connection-wait-time>
Description I created a
simple WAR that you can drop into any resin instance to see what I'm seeing.
I'll also include a link to my production server where you can see it

 I wrote a JSP page that launches a several threads, grabs connections from
the DataSource, sleeps, then returns the connection to the pool.

I have a datasource configured in resin.conf as follows:

     <driver type="com.mysql.jdbc.Driver">
       <url>jdbc:mysql://xxx</url> [^]

A url such as the following hit's this WAR on my production box [^]

So it's creating 20 threads, with a sleep time of 2s of holding onto the

The first time you hit this page you'll notice you get exceptions that the
some of the threads were unable to retrieve connections (pool was full).
But it shouldn't be. Those threads did not wait 10s. Although they do
appear to wait roughly 2s, which means just about the time the connections
where available they are returning the pool is full.

If you reload the page you'll notice it works. That is, all 20 threads get
a connection the entire page load takes about 4s.

If you wait 15s for the pool to release idle connections, then reload the
page, the errors will reappear.

So the issue appears to be that the pool is mistakenly throwing a Pool is
full exception when the pool is growing or it's trying to grow. Once the
pool is full it seems to function as advertised.
Additional Information
Attached Files  con-war-1.0.war [^] (11,425 bytes) 01-05-10 15:00

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
01-05-10 15:00 alex New Issue
01-05-10 15:00 alex File Added: con-war-1.0.war
01-07-10 10:00 ferg Assigned To  => ferg
01-07-10 10:00 ferg Status new => closed
01-07-10 10:00 ferg Resolution open => fixed
01-07-10 10:00 ferg Fixed in Version  => 3.1.10

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker