tidb v5 连接池异常中断

两套tidb 5集群 同样的连接池连接 其中一套持续跑任务的时候会中断,tidb.log

[2021/11/17 18:03:18.572 +08:00] [INFO] [coprocessor.go:794] ["[TIME_COP_WAIT] resp_time:46.934003482s txnStartTS:429167306761568257 region_id:231493 store_addr:10.10.5.111:20160 kv_process_ms:1 kv_wait_ms:0 processed_versions:2 total_ve
rsions:3 rocksdb_delete_skipped_count:0 rocksdb_key_skipped_count:2 rocksdb_cache_hit_count:10 rocksdb_read_count:0 rocksdb_read_byte:0"]
[2021/11/17 18:03:18.659 +08:00] [WARN] [domain.go:402] [“loading schema takes a long time”] [“take time”=47.513063957s]

================================================
com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2001) create connection error, url: jdbc:mysql://10.10.5.110:4000/tgouorder?useUnicode=true&characterEncoding=utf8, errorCode 0, state 08S01
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:989)
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:341)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2251)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:806)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
at sun.reflect.GeneratedConstructorAccessor70.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1421)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1477)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1998)
Caused by: java.net.ConnectException: 拒绝连接 (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:300)
… 14 more

另外一套容易中断的tidb,是什么状态呢? 掉线,还是服务异常?
有相关异常的日志可以提交上来么?

然后,具体是什么执行什么任务会挂掉?
整个集群是个什么配置?数据量大概是多少?是什么样的结构

是通过连接池连接到tidb的连接断开了,每次跑任务都会断开,tidb的log就是上面提交的,没什么特别的异常信息,集群状态都正常,任务是跑批处理 批量读取tidb数据到其他地方。

这些信息不足够帮助判断问题咯,最好在补充一下

1、确认下,在两个集群跑的任务是相同类似的任务吗?会不会是某个集群跑的任务比较重呢?
2、通过监控,查看连接到TiDB-Server的监控的内存、CPU情况,确认是否有OOM的问题。

持续关注中