Closed Bug 126755 Opened 23 years ago Closed 23 years ago

DNS: multiple IP addresss failover (when timeout occurs)

Categories

(Core :: Networking: HTTP, defect, P2)

x86
FreeBSD
defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: sumikawa, Assigned: darin.moz)

Details

Attachments

(1 file, 2 obsolete files)

bugzilla#86917(multiple ip trying) still has a bug. http://bugzilla.mozilla.org/show_bug.cgi?id=86917 multiple ip trying works correctly when connection is refused. However it does not work when connection is timed out. I'll attach the patch. In this patch, new mCurrentState is eSocketState_WaitConnect after timed out but I'm not sure if this is correct. Could you review it and commit it?
Attached patch fix timeout falling back bug (obsolete) — Splinter Review
Here is the patch.
-> Darin the Http master
Assignee: new-network-bugs → darin
Status: UNCONFIRMED → NEW
Component: Networking → Networking: HTTP
Ever confirmed: true
Keywords: patch, review
QA Contact: benc → tever
-> moz 1.0 thanks for the patch...
Severity: normal → major
Status: NEW → ASSIGNED
Keywords: nsbeta1
Priority: -- → P2
Target Milestone: --- → mozilla1.0
Keywords: mozilla1.0
Keywords: nsbeta1+
Keywords: nsbeta1
Attached patch revised patch (obsolete) — Splinter Review
- factored out some of the common code. - ensure that we don't try the next address if we've already fired OnStartRequest. we fire OnStartRequest once we've made a successful connection. there may be some issues with this patch and SSL since SSL doesn't always complete a connection until the first Read or Write on the socket. i assume though that it will have made at least the initial TCP/IP handshake by the time doConnection succeeds. otherwise, this patch may need to be rethought.
Attachment #70566 - Attachment is obsolete: true
wtc: the initial call to PR_Connect on a NSS PRFileDesc corresponds to a TCP/IP SYNC right? so, we'll know by the time we try to read or write on the socket that we've successfully transmitted some packets to the server, right?
Munechika: can you test this patch? i'm not exactly sure how best to simulate a TCP/IP timeout error.
Darin wrote: > the initial call to PR_Connect on a NSS PRFileDesc corresponds > to a TCP/IP SYNC right? This is true for a NSS PRFileDesc. > so, we'll know by the time we try to read or write on the socket > that we've successfully transmitted some packets to the server, > right? I think so. I don't understand why you asked this question though.
Darin, This is how the ssl_SecureConnect() function is implemented: http://lxr.mozilla.org/mozilla/source/security/nss/lib/ssl/sslsecur.c#856 It invokes the connect method on the lower-layer PRFileDesc. So I think your assumption is valid: i assume though that it will have made at least the initial TCP/IP handshake by the time doConnection succeeds.
wtc: the point of my question was to make sure that we cannot advance to the read/write state without knowing for sure that the socket connection has been established. i know this to be true of normal sockets, but wasn't 100% sure about NSS sockets. thanks for verifying things for me :-)
Darin, I've confirmed your revised patch works correctly in both situation: 1. fallback when connection refused 2. fallback when timeout
Munechika: excellent! thank you for testing this patch :-)
Comment on attachment 73122 [details] [diff] [review] revised patch Do you really want to attempt another IP if mStatus is an error other than NS_ERROR_CONNECTION_REFUSED?
dougt: sure... how about connection attempt timed out? or no route to host (which is currently mapped to NS_ERROR_CONNECTION_REFUSED). the point is that if we have trouble connecting to a particular IP address, and if DNS provides other IP addresses, we should try those other IP addresses before giving up.
talked to dougt over AIM... probably is best to only enter TryNextAddress do to specific errors, not just any error. ... will put together another patch.
Attached patch v3 patchSplinter Review
Attachment #73122 - Attachment is obsolete: true
Comment on attachment 74354 [details] [diff] [review] v3 patch thanks r=dougt
Attachment #74354 - Flags: review+
Comment on attachment 74354 [details] [diff] [review] v3 patch a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #74354 - Flags: approval+
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
VERIFIED: linux 2002040908 (right before the branch date) I configured a dual entry that points to a dead address and a real-life server: nslookup news.cpd.mcom.com Server: regress.nscp.aoltw.net Address: 10.169.115.222 Name: news.cpd.mcom.com Addresses: 10.169.115.221, 64.124.237.133 It took me a while to verify the behavior, but I see that it tries to connect to internal (dead) address, then it goes to the real-deal on the public network. I'm not sure if I'm seeing too many ARPs, so I'm posting the list here, and I'll try to dig up my TCP/IP illustrated book later. # snoop arp Using device /dev/le (promiscuous mode) carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ? carbuncle -> (broadcast) ARP C Who is 10.169.115.221, 10.169.115.221 ?
Status: RESOLVED → VERIFIED
Summary: bugzilla#86917(multiple ip trying) still has a bug → DNS: multiple IP addresss failover (when timeout occurs)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: