TiDB版本:5.7.25-TiDB-v4.0.0
问题描述:使用:commons-dbcp-1.4.jar构建连接池(配置如下);发现隔一段时间就会标题中的错误,增加failOverReadOnly=false
并不起作用;请问tidb的默认连接有效时间(参数)是多久?为何失效后自动重连不起作用?
int initialSize = 400;
int maxActive = 400;
int minActive = 400;
int maxIdle = 400;
int minIdle = 400;
long maxWait = 200;
long maxIdleTime = 200;
String url="jdbc:mysql://"+host+":"+port+"/"+db+"?autoReconnect=true&failOverReadOnly=false";
MySQL [(none)]> show variables like ‘%timeout%’ ;
±-------------------------------±---------+
| Variable_name | Value |
±-------------------------------±---------+
| connect_timeout | 10 |
| delayed_insert_timeout | 300 |
| innodb_flush_log_at_timeout | 1 |
| innodb_lock_wait_timeout | 50 |
| innodb_rollback_on_timeout | 0 |
| interactive_timeout | 28800 |
| lock_wait_timeout | 31536000 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| rpl_semi_sync_master_timeout | |
| rpl_stop_slave_timeout | 31536000 |
| slave_net_timeout | 3600 |
| tidb_wait_split_region_timeout | 300 |
| wait_timeout | 28800 |
±-------------------------------±---------+