Bug #43421 LoadBalancingConnectionProxy.doPing() needs blacklist awareness
Submitted: 5 Mar 2009 15:47 Modified: 9 Mar 2009 17:59
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
Category:Connector / J Severity:S4 (Feature request)
Version:5.1.7 OS:Any
Assigned to: Todd Farmer CPU Architecture:Any

[5 Mar 2009 15:47] Todd Farmer
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 2009 20:11] Todd Farmer
patch for feature and test case.

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

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

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

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

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

[6 Mar 2009 20:58] Todd Farmer
Fixed patch

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

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

[7 Mar 2009 5:56] Jess Balint
will be released in 5.1.8
[9 Mar 2009 17: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.