Issues

Select view

Select search mode

 

Resource leak in DatasourceConnectionPool 5.3.10

Fixed

Description

(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.

Environment

None

Details

Assignee

Reporter

Priority

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

Activity

Show:

Michael Offner9 June 2023 at 17:43

applied for 5.4

reverted for 5.3 because at this point we only to security updates on 5.3

 

Lucee 6 uses common pool 2 for connection pooling, so that change does not apply for 6.

Darrell R Taylor6 January 2023 at 21:01

 

There is a PR for this here:

Flag notifications