Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1126000

Summary: [GSS](6.4.0) HHH-9312 - Connection handle leak from hibernate afterCompletion method
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Matthew Robson <mrobson>
Component: HibernateAssignee: Gail Badner <gbadner>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Simka <msimka>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0, 6.1.1CC: bbaranow, bmaxwell, jmartisk, kkhan, msimka, sfikes, smarlow
Target Milestone: DR11   
Target Release: EAP 6.4.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1121629, 1126959    
Attachments:
Description Flags
1 instance of the leaked connection with ccm=true debug=true none

Description Matthew Robson 2014-08-01 14:45:05 UTC
Created attachment 923329 [details]
1 instance of the leaked connection with ccm=true debug=true

Description of problem:

The hibernate afterCompletion method isn't closing the connection from the reaper thread and thus returns with a connection handle of 1.  IJ then does not return the connection during afterCompletion due to the non 0 connection handle and the connection is leaked.

Tested the theory using 'hibernate.jta.track_by_thread = false' which gives Hibernate the ability to close connections from the Reaper thread to prove the issue.  This, however, doesn't work as a solution due to concurrency issues.


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

EAP 6.x & Hibernate 4.1.x / 4.2.x

How reproducible:

100%

Steps to Reproduce:

Note: These steps reflect the method by which this can be reproduced 100% of the time, not the real world scenario in which this occurs at random.

1. Thread outside the current transaction blocks for update on a row
2. Thread inside a transaction finds and updates the row which is blocked until the transaction times out.
3. With CCM, you see IJ000100, without, connection is leaked.

Actual results:

Connection is leaked from the pool permanently.

Expected results:

No connection leak.

Additional info:

Comment 4 Gail Badner 2014-11-21 03:00:45 UTC
Fixed for EAP 6.4.0.

Comment 5 Kabir Khan 2014-11-21 11:35:28 UTC
Fixed by Hibernate 4.2.16.Final upgrade https://bugzilla.redhat.com/show_bug.cgi?id=1121629

Comment 6 Jan Martiska 2014-11-27 12:40:59 UTC
Verified in EAP 6.4.0.DR11 / Hibernate 4.2.16.Final-redhat-1.