commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Sergeev (JIRA)" <>
Subject [jira] Commented: (DBCP-244) Connection socket hangs sporadically in DBCP 1.2.2 but not 1.2.1
Date Thu, 01 Jul 2010 14:34:53 GMT


Alexey Sergeev commented on DBCP-244:

 The probem is reproducibe  - that's for sure!
To reach the problem you need to reconfigure MySQL server a little. I.e. update my.ini (on
Windows) or my.cnf (on Linux) and set idle conection timeout to  smaller value:
# use one minute timeout

Default value is 8 hours so it is not so eacsy to reproduce "broken pipe" error so easy (not
so feasible).

So if you run you application (with commons-dbcp-1.2.2.jar) on mysql configured in this way
you will be able to get the exception ().

I've tried to use additional properties like maxOpenPreparedStatements, validationQuery nd
etc. But it does NOT help!

But one this that works ALWAYS - is using commons-dbcp-1.2.1.jar.

So guys,  could you fix this REAL problem and provide new release?! Or at least explayn what
has been changed in new DBCP and how exacly it could be properly configured?

> Connection socket hangs sporadically in DBCP 1.2.2 but not 1.2.1
> ----------------------------------------------------------------
>                 Key: DBCP-244
>                 URL:
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>         Environment: Fedora Core 3, MySQL 4.1.22. with the latest driver (5.07). Exceptions
only occur in the "job processing" JVM, which sits idle for long periods of time and occasionally
wakes up to interact with the database.
>            Reporter: ori
>             Fix For: 1.3
> I think I've traced an exception to DBCP's code.
> Communication with the database is hanging sporadically in a production environment.
If I don't set the socketTimeout property on the underlying connection, it will hang forever.
With the socketTimeout property, I get the following exception:
> -------
> com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying
> MESSAGE: Read timed out
> Read timed out
>        at Method)
>        at
>        at com.mysql.jdbc.util.ReadAheadInputStream.fill(
>        at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(
>        at
>        at com.mysql.jdbc.MysqlIO.readFully(
>        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(
>        at com.mysql.jdbc.MysqlIO.checkErrorPacket(
>        at com.mysql.jdbc.MysqlIO.sendCommand(
>        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
>        at com.mysql.jdbc.Connection.execSQL(
>        at com.mysql.jdbc.Statement.executeUpdate(
>        at com.mysql.jdbc.Statement.executeUpdate(
>        at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(
> ...
> -------
> It always happens in an infrequently used JVM (not an app server handling frequent connections).
So it's likely the offending connection was asleep for a long time before the exception occurs.

> I've confirmed that this issue only occurs using 1.2.2 and not 1.2.1. I've been looking
through the changelogs but can't find anything that would cause this behavior.
> Does somebody familiar with the codebase have any idea what change (1.2.1->1.2.2)
could be causing this behavior? 
> Thanks

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message