Bug 66502 - tomcat-jdbc ConnectionPool.returnConnection() accept closed connections
Summary: tomcat-jdbc ConnectionPool.returnConnection() accept closed connections
Status: NEW
Alias: None
Product: Tomcat Modules
Classification: Unclassified
Component: jdbc-pool (show other bugs)
Version: unspecified
Hardware: PC Mac OS X 10.1
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-01 22:09 UTC by Zhong Yu
Modified: 2023-03-02 09:15 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhong Yu 2023-03-01 22:09:03 UTC
When a connection is checked out from pool, it could be forcefully closed by the server. The connection is then returned to the connection pool, available for more borrow/returns; the same broken connection causes plurals of failures for the application, until `validationInterval` is reached when there's a chance to evict the connection.

Proposal: PooledConnection.validate(VALIDATE_RETURN) checks underlying `connection.isClosed()` unconditionally. This should be an inexpensive check.
Comment 1 Mark Thomas 2023-03-02 09:15:59 UTC
Correct component and set as enhancement