Bug 307784 - Flawed server connect timeout handling for multi-homed hosts
Summary: Flawed server connect timeout handling for multi-homed hosts
Status: RESOLVED DUPLICATE of bug 63088
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 4.9.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-03 16:58 UTC by Graeme Hewson
Modified: 2018-04-25 21:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graeme Hewson 2012-10-03 16:58:11 UTC
If a Web server has more than one network address and a connection to the first address times out, kio tries another address immediately before timing out. Even if the connection to the second address succeeds, kio immediately disconnects it.

Actually, I only have one case of this happening, but I assume the above general description is correct. This case is http://www.tcpdump.org. The host resolves to six addresses:

host www.tcpdump.org
www.tcpdump.org has address 178.77.96.193
www.tcpdump.org has address 132.213.238.6
www.tcpdump.org has address 69.4.231.52
www.tcpdump.org has IPv6 address 2607:f0d0:3001:62:1::52
www.tcpdump.org has IPv6 address 2001:4830:116e:2::6

Five addresses are live, but 2001:4830:116e:2::6 is not. Konqueror and Rekonq obstinately try to connect to this address every time I hit the browser reload button. Firefox also tries this address at first, but after about 250ms tries one of the IPv4 addresses and succeeds.

With the default 20s server connect timeout, the following happens (Time is relative to the first packet; Dir(ection) is -> for outbound and <- for inbound):

Time        Dir Host                    TCP flags

0           ->  2001:4830:116e:2::6     SYN
0.9         ->  2001:4830:116e:2::6     SYN
3           ->  2001:4830:116e:2::6     SYN
7           ->  2001:4830:116e:2::6     SYN
15          ->  2001:4830:116e:2::6     SYN
19.7        ->  2607:f0d0:3001:62:1::52 SYN
19.8        <-  2607:f0d0:3001:62:1::52 SYN,ACK
19.8        ->  2607:f0d0:3001:62:1::52 RST

With the timeout set to 30s, the pattern is the same. The first 15s are identical, then:

Time        Dir Host                    TCP flags

29.7        ->  2607:f0d0:3001:62:1::52 SYN
29.8        <-  2607:f0d0:3001:62:1::52 SYN,ACK
29.8        ->  2607:f0d0:3001:62:1::52 RST

I think if the connection to another address succeeds, kio should use it, especially when it succeeds (just) within the timeout setting!

With the timeout set to 120s, everything works after 30s, and the browser successfully displays the content:

Time        Dir Host                    TCP flags

[0-15 same]
30.0        ->  2607:f0d0:3001:62:1::52 SYN 
30.1        <-  2607:f0d0:3001:62:1::52 SYN,ACK
30.1        ->  2607:f0d0:3001:62:1::52 ACK

Possibly related to bug 63088?
Comment 1 Nate Graham 2018-04-25 21:00:41 UTC

*** This bug has been marked as a duplicate of bug 63088 ***