com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
niksw7 Jun 20, 2014 10:46 AMI am running JBOSS 7.2 which communicates with the DB running on separate machines in HA mode (2 DB node are running, one in standby and other in active mode) .
JAS7.2 communicates with DB through virtual IP so that failure of one node shouldn't affect the communication with DB.
Now when ever standby DB node is taking over active node i.e. stopping standby abruptly making other node active, JAS is failing to communicate with DB for around 1 min.
During this 1 minute DB is accessible through virtual IP. It hardly takes 2/3 secs to takeover from standby to active, thus it is expected that JAS should perform seamless.
JAS throws following error for 1 minute:
2014-06-20 01:27:30,604 10.4.198.81 (rsyncJobsManager-278) ERROR [com.omneon.common.msg.MessageFactory] {MsfMessaging} MessageFactory::consumeMessageFromJobTable RsyncJobEntry
com.omneon.common.exception.MdlException: Broken pipe
at com.omneon.common.msg.MessageFactory.getJobInQueueBySelector(MessageFactory.java:918)
at com.omneon.common.msg.MessageFactory.consumeMessageFromJobTable(MessageFactory.java:1032)
at com.omneon.common.msg.MessageFactory.consumeMessageFromJobTable(MessageFactory.java:994)
at com.omneon.common.msg.MessageFactory.consumeMessage(MessageFactory.java:715)
at com.omneon.dam.msg.QueueMessageManager.run(QueueMessageManager.java:265)
at java.lang.Thread.run(Thread.java:744)
at com.omneon.common.msg.MsfThread.run(MsfThread.java:42)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 28,468 milliseconds ago. The last packet sent successfully to the server was 11,523 milliseconds ago.
at sun.reflect.GeneratedConstructorAccessor344.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3364)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1983)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1557)
at org.jboss.jca.adapters.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:344)
at com.omneon.common.msg.MessageFactory.getJobInQueueBySelector(MessageFactory.java:881)
... 6 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3343)
... 13 more
datasource in standalone-full-ha.xml has been configured as below :
<datasource jta="true" jndi-name="java:jboss/MSFDS"
pool-name="MSFDS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://${msf.db.ip.address}:3306/omneon?autoReconnect=true</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>com.mysql</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED
</transaction-isolation>
<pool>
<min-pool-size>20</min-pool-size>
<max-pool-size>500</max-pool-size>
</pool>
<security>
<user-name>root</user-name>
<password>omneon</password>
</security>
<validation>
<valid-connection-checker
class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker" />
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<use-fast-fail>false</use-fast-fail>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySqlExceptionSorter"/>
</validation>
<timeout>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>3</idle-timeout-minutes>
</timeout>
</datasource>
With this configuration JBOSS 4.2 worked seamlessly; it used to resume DB connections in at max 3/4 secs.
Can someone please suggest any additional configuration is required to make JAS7.2 to work seamlessly?