Bug 841389

Summary: Scaled JBoss AS7 app breaks after a couple of hits against mysql: Communications link failure
Product: OKD Reporter: Nam Duong <nduong>
Component: ContainersAssignee: Dan Mace <dmace>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: cgole, dueyese, jofernan, mcaspers, mpatel, wdecoste
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: devenv_1920+ Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 20:42:48 UTC 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:

Description Nam Duong 2012-07-18 20:33:21 UTC
Description of problem:
This is in reference to forum post: https://openshift.redhat.com/community/forums/openshift/mysql-connection-issue

I was able to reproduce this issue with our https://github.com/openshift/kitchensink-example sample application with the following:
1) rhc app create -a kitchensink -t jbossas-7 -s
2) rhc app cartridge add -a kitchensink -c mysql5.1
3) Updated .openshift/config/standalone.xml:
<datasource jndi-name="java:jboss/datasources/MysqlDS" enabled="true" use-java-context="true" pool-name="MysqlDS">
//NOTE that I had to force the setting enabled="true" 
4) Updated src/main/resources/META-INF/persistence.xml:
<jta-data-source>java:jboss/datasources/MysqlDS</jta-data-source>
//NOTE that we need to use MysqlDS here

Then I hit the app URL:
https://kitchensink-macdomain.rhcloud.com/index.jsf

First few transactions worked correctly and I was able to update the database by entering Name/Email/Phone number.  After a couple of tries, the app fails as it is failing now with 500 error.  The errors in the framework gear is closely related with what the user has posted in the forums (although not an exact stack trace match since it's not the exact same app):

Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Comment 1 Bill DeCoste 2012-07-27 17:09:29 UTC
Adding the following to the mysql datasource in standalone.xml will make jboss resilient to the connection drops/closures but this is probably just hiding the real problem:

<validation>
 <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
</validation>

Comment 2 Bill DeCoste 2012-07-27 21:37:01 UTC
I've added the above for AS7/EAP for mysql/postgres

Comment 3 Chandrika Gole 2012-07-30 23:20:06 UTC
I am trying to verify this bug but I am seeing a new issue here where the gears go down when I run steps 3 & 4. I have tried this twice and ran into the same problem.

Steps to reproduce -

1) rhc app create -a kitchensink -t jbossas-7 -s
Add this upstream kitchensink repo
cd kitchensink
git remote add upstream -m master git://github.com/openshift/kitchensink-example.git
git pull -s recursive -X theirs upstream master
Then push the repo upstream
git push
Access the app and make sure its working
2) rhc app cartridge add -a kitchensink -c mysql5.1
3) Updated .openshift/config/standalone.xml:
<datasource jndi-name="java:jboss/datasources/MysqlDS" enabled="true" use-java-context="true" pool-name="MysqlDS">
//NOTE that I had to force the setting enabled="true" 
4) Updated src/main/resources/META-INF/persistence.xml:
<jta-data-source>java:jboss/datasources/MysqlDS</jta-data-source>
//NOTE that we need to use MysqlDS here
5) Push the changes to git 


Expected - 
The gear should be up and the app should be served

Actual -

Gear is down. 

How reproducible -
Always

Comment 4 Dan Mace 2012-07-31 13:29:50 UTC
Please file new issues for different bugs. Gears falling down could be a duplicate of bug 842977. If the originally reported issue is resolved, let's close this one out.

Comment 5 Dan Mace 2012-07-31 14:23:06 UTC
*** Bug 844470 has been marked as a duplicate of this bug. ***

Comment 6 Chandrika Gole 2012-07-31 23:11:52 UTC
verified