Bug 1054224 - (6.3.z) Datasource recreated upon delete or disable if max connections are in use
Summary: (6.3.z) Datasource recreated upon delete or disable if max connections are in...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JCA
Version: 6.2.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: CR1
: EAP 6.3.2
Assignee: Jesper Pedersen
QA Contact: Martin Simka
URL:
Whiteboard:
Depends On: 1147412
Blocks: eap632-blockers, eap632-payload 1147881
TreeView+ depends on / blocked
 
Reported: 2014-01-16 13:37 UTC by Matthew Robson
Modified: 2019-08-19 12:42 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1147412 (view as bug list)
Environment:
Last Closed: 2019-08-19 12:42:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
trace logs with bug reproduced (173.53 KB, text/x-log)
2014-01-16 13:37 UTC, Matthew Robson
no flags Details
stats with bug reproduced (1.44 KB, text/x-log)
2014-01-16 13:38 UTC, Matthew Robson
no flags Details
trace logs for pass scenario (114.80 KB, text/x-log)
2014-01-16 13:39 UTC, Matthew Robson
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBJCA-1212 0 Critical Closed Pool could keep connections open after shutdown 2018-10-15 06:12:10 UTC

Description Matthew Robson 2014-01-16 13:37:06 UTC
Created attachment 851073 [details]
trace logs with bug reproduced

Description of problem:
Customer case (https://c.na7.visual.force.com/apex/Case_View?id=500A000000HlfkX&sfdc.override=1) in which they said connections weren't being properly torn down if they deleted or disabled their Oracle datasource.

Version-Release number of selected component (if applicable):
JBoss EAP 6.2

How reproducible:
Your application must have all connections from a datasource InUse and then disable or delete that datasource.  This will cause all of the connections to be destroyed but will also throw a 'RetryableException' causing the datasource to be re-created while its being destroyed.  This leaves you with a non-existent datasource having X number of open connections to your database where X is the min pool size setting in your config.

If you do not have ALL connections available InUse and your disable or delete the datasource, all connections are properly torn down and a 'RetryableException' is not throw resulting in no pool re-creation.

Steps to Reproduce:
1) I created a standard Oracle Datasource with min connections of 5 and max connections of 30
2) I modified the default helloworld quickstart with a JSP that opens a Database connection, does a select and prints out the results.  I put this into a basic loop of 25 iterations and purposefully did not close the Database connection in order to create a bunch of InUse connections. 
3) I ran the JSP until it completed and it produced 25 InUse connections.
4) netstat -anp shows the 25 ESTABLISHED connections from my JBoss process to my Oracle DB.
5) select * from v$session in Oracle shows 25 open connections from JBoss.
6) I ran the JSP a second time until my server hit 30 (max) InUse connections.
7) netstat -anp shows the 30 ESTABLISHED connections from my JBoss process to my Oracle DB.
8) select * from v$session in Oracle shows 30 open connections from JBoss.
9) I stopped the datasource and I see 30 instances of 'WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (MSC service thread 1-7) IJ000615: Destroying active connection in pool: testpool' that indicates all the connections were destroyed,
10) netstat -anp now shows 5 connections from my JBoss process to my Oracle DB still in the ESTABLISHED state.
11) select * from v$session in Oracle now shows 5 open connections from JBoss.

Actual results:
The datasource is re-created and establishes X number of connections to the database where X is the value of min connection for your pool.

Expected results:
The datasource should not be re-created due to the exception and there should be no open connections left to the Database.

Additional info:

Log with bug reproduced:
01007809bug.trace.log
01007809bug.stats.log

Log from a passing scenario:
01007809pass.trace.log
01007809pass.stats.log

Comment 1 Matthew Robson 2014-01-16 13:38:25 UTC
Created attachment 851074 [details]
stats with bug reproduced

Comment 2 Matthew Robson 2014-01-16 13:39:13 UTC
Created attachment 851075 [details]
trace logs for pass scenario

Comment 4 Jesper Pedersen 2014-09-02 19:58:23 UTC
Use EAP 6.3+

Comment 9 Jesper Pedersen 2014-09-04 19:57:23 UTC
Let me take another look then

Comment 10 JBoss JIRA Server 2014-09-16 12:18:04 UTC
Jesper Pedersen <jpederse> updated the status of jira JBJCA-1212 to Closed

Comment 15 Martin Simka 2014-10-21 13:35:39 UTC
verified on EAP 6.3.2.CP.CR1


Note You need to log in before you can comment on or make changes to this bug.