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)
Tracking
()
VERIFIED
FIXED
mozilla1.0
People
(Reporter: sumikawa, Assigned: darin.moz)
Details
Attachments
(1 file, 2 obsolete files)
3.98 KB,
patch
|
dougt
:
review+
rpotts
:
superreview+
asa
:
approval+
|
Details | Diff | Splinter Review |
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?
Reporter | ||
Comment 1•23 years ago
|
||
Here is the patch.
Comment 2•23 years ago
|
||
-> Darin the Http master
Assignee | ||
Comment 3•23 years ago
|
||
-> moz 1.0
thanks for the patch...
Severity: normal → major
Status: NEW → ASSIGNED
Keywords: nsbeta1
Priority: -- → P2
Target Milestone: --- → mozilla1.0
Assignee | ||
Updated•23 years ago
|
Keywords: mozilla1.0
Assignee | ||
Comment 4•23 years ago
|
||
- 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
Assignee | ||
Comment 5•23 years ago
|
||
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?
Assignee | ||
Comment 6•23 years ago
|
||
Munechika: can you test this patch? i'm not exactly sure how best to simulate a
TCP/IP timeout error.
Comment 7•23 years ago
|
||
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.
Comment 8•23 years ago
|
||
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.
Assignee | ||
Comment 9•23 years ago
|
||
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 :-)
Reporter | ||
Comment 10•23 years ago
|
||
Darin, I've confirmed your revised patch works correctly in both
situation:
1. fallback when connection refused
2. fallback when timeout
Assignee | ||
Comment 11•23 years ago
|
||
Munechika: excellent! thank you for testing this patch :-)
Comment 12•23 years ago
|
||
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?
Assignee | ||
Comment 13•23 years ago
|
||
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.
Assignee | ||
Comment 14•23 years ago
|
||
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.
Assignee | ||
Comment 15•23 years ago
|
||
Attachment #73122 -
Attachment is obsolete: true
Comment 16•23 years ago
|
||
Comment on attachment 74354 [details] [diff] [review]
v3 patch
thanks r=dougt
Attachment #74354 -
Flags: review+
Comment 17•23 years ago
|
||
Attachment #74354 -
Flags: superreview+
Comment 18•23 years ago
|
||
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+
Assignee | ||
Comment 19•23 years ago
|
||
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 20•23 years ago
|
||
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.
Description
•