> On Mar 9, 2016, at 7:34 AM, Andrus Adamchik <[email protected]> wrote:
> 
>> 
>> On Mar 9, 2016, at 12:52 AM, Hugi Thordarson <[email protected]> wrote:
>> 
>> Nice, works like a charm :).
>> 
>> On a side note, websites that I’ve switched to HikariCP have been up since 
>> the switch, so it does seem to have been a problem with Cayenne’s connection 
>> pool.
> 
> Yeah, I'll jira that. Will need to investigate.

The problem wasn't what I originally thought it was. Instead what happened is 
this: at the moments when the DB was down, 
UnmanagedPoolingDataSource.createUnchecked(..) would decrement a semaphore 
controlling max pool size without creating a connection. So any DB hiccup would 
result in permanent pool shrinkage. 

Just fixed it per https://issues.apache.org/jira/browse/CAY-2067 .

(Lack of) fair scheduling limitation mentioned by John still exists. So when 
there is a contention, failure rate may be higher then it would be with fair 
scheduling (I observed this in my unit tests, even though I wasn't specifically 
testing this condition). Shouldn't be an issue if the pool has enough 
connections. 

Still a third party pool is probably a better choice for production. Like I 
said, our pool is intentionally basic.

Andrus

Reply via email to