Communications link failure
Posted by: Alexander Lang
Date: May 07, 2010 02:52PM

I'm getting the below exception on my application after periods of heavy load.

org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.mysql.jdbc.CommunicationsException: Communications link failure

Last packet sent to the server was 354 ms ago.)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(
Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure

Last packet sent to the server was 354 ms ago. at com.mysql.jdbc.SQLError.createCommunicationsException(
at com.mysql.jdbc.ConnectionImpl.createNewIO(
at com.mysql.jdbc.ConnectionImpl.<init>(
at com.mysql.jdbc.ConnectionImpl.getInstance(
at com.mysql.jdbc.NonRegisteringDriver.connect(
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(
... 18 more
Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure

Last packet sent to the server was 338 ms ago.
at com.mysql.jdbc.SQLError.createCommunicationsException(
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.secureAuth411(
at com.mysql.jdbc.MysqlIO.doHandshake(
at com.mysql.jdbc.ConnectionImpl.createNewIO(
... 22 more
Caused by: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(
... 28 more

It appears that the MySql server is not returning any packets during the handshake process when JBoss tries to get a connection.

I am not seeing any Socket or IOExceptions so it appears that the actual socket connection and underlying streams are valid - and that the driver was able to connect to Mysql. The driver makes a legal "read" to get the Mysql server's handshake response but is just getting an empty stream. Both the appserver and Mysql report that there are available connections in "sleep" state. Mysql is not responding during the handshake.

This behavior happens after a period of heavy load on the appserver.

I've done some tests such as manually killing connections on the MySql side (which results in a Socket exception) and forcing "net_write_timeouts" to be exceeded. But the error outcomes are different.

Anyone ever experience similar problems?

Options: ReplyQuote

Written By
Communications link failure
May 07, 2010 02:52PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.