Bug 785195

Summary: Client connection to Domain Name with multiple IP addresses by round robin does not work effectively
Product: Red Hat Enterprise MRG Reporter: Zdenek Kraus <zkraus>
Component: qpid-cppAssignee: Andrew Stitcher <astitcher>
Status: CLOSED WONTFIX QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1CC: astitcher, jross
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-22 14:35:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 802466    

Description Zdenek Kraus 2012-01-27 15:30:21 UTC
Description of problem:
When for one Domain name is returned more IP address records and they are unavailable, client should try all results by round robin mechanism.

But it is N-Round robin, that is trying n-times one IP and has a exponential backoff with t_n = 3 * 2^n time complexity. With N=6 as the client attemps 6 times, the whole time for one IP is SUM(3*2^n) for n=0..5 so 186s.

NOTE: this is problem not only of qpid-cpp, but python also

Version-Release number of selected component (if applicable):
python-qpid-0.14-1.el5
qpid-java-example-0.14-1.el5
qpid-cpp-client-0.14-3.el5
qpid-jca-0.14-4.el5
qpid-java-client-0.14-1.el5
qpid-jca-xarecovery-0.14-4.el5
qpid-qmf-debuginfo-0.14-2.el5
qpid-cpp-mrg-debuginfo-0.14-3.el5
qpid-cpp-client-ssl-0.14-3.el5
qpid-cpp-client-devel-0.14-3.el5
qpid-qmf-devel-0.14-2.el5
qpid-java-common-0.14-1.el5
qpid-cpp-client-devel-docs-0.14-3.el5
qpid-tools-0.14-1.el5

How reproducible:
100%

Steps to Reproduce:
1. prepare some ip addresses with ip address add <ip>/<mask> dev <interface>
2. prepare DNS for that ip addresses and some domain name
3. check DNS response by dig ANY <domainname> +short
4. clear both IPv4 and IPv6 iptables by iptables -F and ip6tables -F
5. block all ip addresses except last in DNS response by:
iptables -A INPUT -p tcp --source <ip> -j REJECT
iptables -A INPUT -p tcp --destination <ip> -j REJECT
for ipv6 use ip6tables
6. start broker
7. start tcpdump -n -i lo tcp port <brokerport>
8. start client with domain name to broker example qpid-perftest --count 1 -b <domainname>
9. examine delays and how the IPs are tried
  
Actual results:
N-Round Robin with exponential backoff that 6times tries one IP tables with delay 186s, and then go for next

Expected results:
Round Robin with exponential backoff, that tries all addresses sequentially with first delay (3s), then again tries all addresses with increased backoff, ...

Additional info: