java - MySQL tomcat JDBC Connection pool testOnBorrow check does not get a response -
my application using tomcat jdbc connection pool connect remote mysql database following connection pool configurations,
maxactive: 80 maxwait: 60000 minidle: 5 testonborrow: true validationquery: select 1 validationinterval: 30000 validationquerytimeout: 10
most of time works fine application seems stuck when executing testonborrow on connection pool. discovered enabling java flight recorder , showed following stack trace,
java.net.socketinputstream.read(byte[], int, int, int) java.net.socketinputstream.read(byte[], int, int) com.mysql.jdbc.util.readaheadinputstream.fill(int) com.mysql.jdbc.util.readaheadinputstream.readfromunderlyingstreamifnecessary(byte[], int, int) com.mysql.jdbc.util.readaheadinputstream.read(byte[], int, int) com.mysql.jdbc.mysqlio.readfully(inputstream, byte[], int, int com.mysql.jdbc.mysqlio.reuseandreadpacket(buffer, int) com.mysql.jdbc.mysqlio.reuseandreadpacket(buffer) com.mysql.jdbc.mysqlio.checkerrorpacket(int) com.mysql.jdbc.mysqlio.sendcommand(int, string, buffer, boolean, string, int) com.mysql.jdbc.mysqlio.sqlquerydirect(statementimpl, string, string, buffer, int, int, int, boolean, string, field[]) com.mysql.jdbc.connectionimpl.execsql(statementimpl, string, int, buffer, int, int, boolean, string, field[], boolean) com.mysql.jdbc.connectionimpl.execsql(statementimpl, string, int, buffer, int, int, boolean, string, field[]) com.mysql.jdbc.statementimpl.execute(string, boolean) com.mysql.jdbc.statementimpl.execute(string) org.apache.tomcat.jdbc.pool.pooledconnection.validate(int, string) org.apache.tomcat.jdbc.pool.pooledconnection.validate(int) org.apache.tomcat.jdbc.pool.connectionpool.borrowconnection(long, pooledconnection, string, string) org.apache.tomcat.jdbc.pool.connectionpool.borrowconnection(int, string, string) org.apache.tomcat.jdbc.pool.connectionpool.getconnection()
so above socket read takes place on remote mysql server on port 3306. socket read lasts approximately 15 minutes until application times out 0 bytes being read during time according jfr recording. not see sql exceptions during time. when application times out , closes connection receive java.io.ioexception: broken pipe.
this occurs , subsequent calls not run issue. not have direct access remote mysql server or network application running on. idea cause , how can overcome?
Comments
Post a Comment