Bug #43421 LoadBalancingConnectionProxy.doPing() needs blacklist awareness
Submitted: 5 Mar 16:47 Modified: 9 Mar 18:59
Reporter: Todd Farmer
Status: Closed
Category:Connector/J Severity:S4 (Feature request)
Version:5.1.7 OS:Any
Assigned to: Todd Farmer Target Version:

[5 Mar 16:47] Todd Farmer
Description:
LoadBalancingConnectionProxy currently implements doPing() to ping all underlying
connections, but it throws any Exceptions it encounters during this process.  If the
global blacklist is enabled, it should instead catch these Exceptions, adding the host to
the global blacklist, and only throwing an Exception if all hosts are down.

How to repeat:
Look at LoadBalancingConnectionProxy.doPing() code.

Suggested fix:
If global blacklist is enabled, catch Exceptions and add host to global blacklist.  If
all hosts are down, throw Exception.
[6 Mar 21:11] Todd Farmer
patch for feature and test case.

Attachment: diff.txt (text/plain), 7.40 KiB.

[6 Mar 21:20] Todd Farmer
Updated patch with better asserts.

Attachment: diff.txt (text/plain), 7.21 KiB.

[6 Mar 21:57] Todd Farmer
Revised locking patch.

Attachment: diff.txt (text/plain), 7.36 KiB.

[6 Mar 21:58] Todd Farmer
Fixed patch

Attachment: diff.txt (text/plain), 7.43 KiB.

[6 Mar 23:18] Todd Farmer
Pushed to 5.1 tree:

http://lists.mysql.com/commits/68563
[7 Mar 6:56] Jess Balint
will be released in 5.1.8
[9 Mar 18:59] Tony Bedford
An entry was added to the 5.1.8 changelog:

LoadBalancingConnectionProxy.doPing() did not have blacklist awareness.

LoadBalancingConnectionProxy implemented doPing() to ping all underlying connections, but
it threw any exceptions it encountered during this process.

With the global blacklist enabled, it catches these exceptions, adds the host to the
global blacklist, and only throws an exception if all hosts are down.