Fixed
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Zac Spitzer
Zac SpitzerPriority
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Created 4 January 2023 at 09:02
Updated 16 June 2023 at 15:43
Resolved 16 June 2023 at 15:43
(from incomplete PR description)
When getDatasourceConnection() decides to create a new connection, it first calls _inc() to increment the connection count. If loadDatasourceConnection() throws a page error, _dec() is called. But if the thread is killed by a timeout _dec() never gets called and so we lose a connection slot. If enough connection slots are lost lucee will not be able to recover when the db comes back.
This changes getDatasourceConnection() so that it only calls _inc() after the connection is successfully opened. This is not a perfect solution since it could allow the ConnectionLimit to be temporarily exceeded.
Also DCStack.isValidEL was doing an incorrect conversion from miliseconds to seconds, that ended up using a timeout of zero. DataSourceSupport.NETWORK_TIMEOUT_IN_SECONDS is set at 10, so a conversion is not needed.