Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 204889EDE for ; Tue, 6 Mar 2012 11:09:22 +0000 (UTC) Received: (qmail 40982 invoked by uid 500); 6 Mar 2012 11:09:21 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 40800 invoked by uid 500); 6 Mar 2012 11:09:21 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 40791 invoked by uid 99); 6 Mar 2012 11:09:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2012 11:09:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2012 11:09:18 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 7405FB8A9 for ; Tue, 6 Mar 2012 11:08:57 +0000 (UTC) Date: Tue, 6 Mar 2012 11:08:57 +0000 (UTC) From: "Dave Oxley (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <776617145.26933.1331032137476.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1580255595.22405.1330956238199.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DBCP-377) Dbcp Idle Check Mechanism Doesn't Work MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DBCP-377?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D132231= 60#comment-13223160 ]=20 Dave Oxley commented on DBCP-377: --------------------------------- This might be a red herring but I recently found and fixed a thread safety = issue when validating connections in DBCP. I don't know if it is relevant t= o the idle check mechanism but it might be worth trying out the fix. Find t= he patch attached to issue DBCP-376 =20 > Dbcp Idle Check Mechanism Doesn't Work > -------------------------------------- > > Key: DBCP-377 > URL: https://issues.apache.org/jira/browse/DBCP-377 > Project: Commons Dbcp > Issue Type: Bug > Affects Versions: 1.4 > Environment: Linux mysql 5.1.4 > Reporter: yixin he > Priority: Critical > > Using :commons-dbcp-1.4.jar version > we use a distributed data access layer for Database Sharding with mysql > our web servers use mysql jdbc driver 1.5.4 to connect to this middleware= layer with F5 between them for load balance. > the middleware layer will discard db links that idle for longger than 1 h= our,and our dbcp configures to close links that idle for=20 > longger than 30 minutes. > here we occurred exceptions as follows: > {code} > java.net.SocketException > MESSAGE: Broken pipe > STACKTRACE: > java.net.SocketException: Broken pipe > at java.net.SocketOutputStream.socketWrite0(Native Method) > at java.net.SocketOutputStream.socketWrite(SocketOutputStream.jav= a:92) > at java.net.SocketOutputStream.write(SocketOutputStream.java:136) > at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.= java:65) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:1= 23) > at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554) > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) > at com.mysql.jdbc.Connection.execSQL(Connection.java:3176) > at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedState= ment.java:1153) > at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.jav= a:794) > .... > at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(De= legatingPreparedStatement.java:172) > at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(De= legatingPreparedStatement.java:172) > {code} > it seems that there are times when the links get from pool they have alre= ady been broken,we know that they are forcely closed by the middleware laye= r=E3=80=81but as dbcp idle check more frequently than the middleware layer(= 30m to 60m). How can this happen as the idle links > should have been closed by dbcp first. Are there any problems for the dbc= p idle check Mechanism=EF=BC=9F > our dbcp configurations are as follows > {code} > 20 > 1 > 60000 > 20 > 5 > true > 180 > clientEncoding=3DGBK > 60000= > 1800000<= /property> > true > false > false > SELECT @@SQL_MODE > 32 > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira