Bug #90931 Configurable ping timeout when activating lightweight ping function
Submitted: 18 May 2018 9:26 Modified: 13 Jul 2018 22:37
Reporter: Lars-Goran Forsberg Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / J Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[18 May 2018 9:26] Lars-Goran Forsberg
Description:
Would it make sense to have support for a separately configurable socket timeout configuration property for lightweight ping queries specifically, e.g. lightweightPingSocketTimeout?

Or perhaps even better a new separate category of specially recognised connection testing ping query (e.g. /* conntest */ SELECT 1) that also would translate to the same lightweight ping as above, but with separate socket timeout, to avoid affecting all lightweight ping queries, e.g. connectionTestTimeout?

This could then be used together with datasource connection testing queries to more quickly detect connection failures due to network or mysqld host failures that otherwise takes TCP timeout or socketTimeout milliseconds to detect, while not having to affect all queries which would be the case when setting the socketTimeout configuration property.

How to repeat:
Set up an HA datasource in e.g. a JEE server, with support for connection testing, and test failover with pulling network cable or powering off the mysqld node currently in use with the JEE server datasource connection pools. It will with default socket timeout options take a long time to detect the socket failure, causing delays in the applications.