Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idle timeout,close connection,reason: idle ,MySQLConnection #2948

Open
DaiYuanchuan opened this issue Jan 29, 2024 · 1 comment
Open

idle timeout,close connection,reason: idle ,MySQLConnection #2948

DaiYuanchuan opened this issue Jan 29, 2024 · 1 comment
Assignees
Labels

Comments

@DaiYuanchuan
Copy link

1、bug描述
mycat报错日志:
2024-01-28 17:21:43.553 INFO [Timer1] (io.mycat.net.AbstractConnection.idleCheck(AbstractConnection.java:531)) - MySQLConnection [id=24, lastTime=1706433403352, user=apsp, schema=apsp, old shema=apsp, borrowed=false, fromSlaveDB=false, threadId=304180, charset=utf8, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=192.168.1.1, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false] idle timeout 2024-01-28 17:21:43.553 INFO [Timer1] (io.mycat.net.AbstractConnection.close(AbstractConnection.java:514)) - close connection,reason: idle ,MySQLConnection [id=24, lastTime=1706433703552, user=apsp, schema=apsp, old shema=apsp, borrowed=true, fromSlaveDB=false, threadId=304180, charset=utf8, txIsolation=3, autocommit=true, attachment=di{select * from user_info where id =123}, respHandler=io.mycat.backend.mysql.nio.handler.MultiNodeQueryHandler@60ba6b93, host=192.168.1.1, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]

2、版本号(非常重要)
mycat: v 1.6.5-RELEASE
mysql: 5.7.43

3、相关表的配置信息
schema.xml
<dataHost name="**" maxCon="200" minCon="200" balance="0" writeType="0" dbType="mysql" dbDriver="native" switchType="1" slaveThreshold="100"> <heartbeat>select 1</heartbeat> <writeHost host="**" url="192.168.1.1:3306" user="apsp" password="**" /> </dataHost>

server.xml
<property name="idleTimeout">300000</property>

4、操作步骤

5、期望结果

6、实际结果

7、额外信息
wait_timeout: 28800 interactive_timeout: 28800

@DaiYuanchuan
Copy link
Author

在Java应用层,执行了一条查询语句,在应用层抛出了异常: java.sql.SQLException: closed connection: idle con:MySQLConnection

它可能是在执行查询的时候,拿到了一个已经失效的连接,就是不知道为什么它会拿到一个失效的连接

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants