-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
druid 的连接ping功能不支持mysql 的 com.mysql.jdbc.ReplicationDriver #1922
Comments
75526cb#diff-65c390cf5861ff596cb3a5b18bc9d6adL50 为什么要清掉ReplicationDriver?导致现在版本上这个issue的问题复现。 |
@starlight36 请问这个bug的修复什么时候时候合并到发布分支,1.1.3和1.1.11分支都没有找到修改,https://github.com/alibaba/druid/blob/master/src/main/java/com/alibaba/druid/pool/vendor/MySqlValidConnectionChecker.java |
mysql-connection 5.1.41 mysql主从 2019-09-06 09:07:16.414 [http-nio-8003-exec-3] ERROR com.alibaba.druid.pool.DruidPooledStatement - CommunicationsException, druid version 1.1.6, jdbcUrl : jdbc:jdbcdslog:mysql:replication://10.1.3.15:3307,10.1.3.16:3307/iot?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&maxReconnects=5&zeroDateTimeBehavior=convertToNull&useSSL=false&readFromMasterWhenNoSlaves=true&targetDriver=com.mysql.jdbc.ReplicationDriver, testWhileIdle true, idle millis 16410, minIdle 10, poolingCount 2, timeBetweenEvictionRunsMillis 60000, lastValidIdleMillis 16410, driver org.jdbcdslog.DriverLoggingProxy Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 57,608,060 milliseconds ago. The last packet sent successfully to the server was 57,608,060 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.The error may exist in com/jiaxun/entity/mapper/DeviceMapper.xmlThe error may involve defaultParameterMapThe error occurred while setting parametersSQL: SELECT d.id,d.device_id,d.device_name, d.user_id, d.project_id, d.identity_id,d.device_type_id, d.device_sn,d.asset_no, d.device_mac, d.device_active, d.device_supplier, d.device_manufacturer,d.device_location, m.id as device_model_id,m.device_model_name, n.id AS rule_id,n.
|
这个bug有解决吗?1.1.14还是有这个问题 |
druid 中 连接检查,优先使用的jdbc 的ping功能,如果不支持,就执行validationQuery检查。
但是ping功能不支持Mysql 的 ReplicationDriver。
if (realDriverClassName.equals(JdbcConstants.MYSQL_DRIVER) // || realDriverClassName.equals(JdbcConstants.MYSQL_DRIVER_6)) { this.validConnectionChecker = new MySqlValidConnectionChecker(); }
如果mysql服务器在超时情况下关闭了连接,而且使用ReplicationDriver时,执行validationQuery检查,只能检测主库的连接,不能检测从库的连接。就会报异常:
com.mysql.jdbc.CommunicationsException: The last packet successfully received from the server was58129 seconds ago.The last packet sent successfully to the server was 58129 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and / or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector / J connection property 'autoReconnect = true' to avoid this problem.
最好Ping功能,可以支持ReplicationDriver。
The text was updated successfully, but these errors were encountered: