Closed Bug 200391 Opened 23 years ago Closed 23 years ago

roaming to a different IP address, get new mail (for pop) stops working (silently fails)

Categories

(Core :: Networking, defect, P1)

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
mozilla1.4beta

People

(Reporter: sspitzer, Assigned: darin.moz)

References

Details

Attachments

(1 file, 1 obsolete file)

roaming to a different IP address, get new mail (for pop) stops working (silently fails) brendan writes: "I see this all the time now running 1.3 on RH8, roaming my thinkpad from work to home, or even from DHCP-based home wireless network to old fixed-IP home network. I haven't snooped the wire, but could it be that some old POP connection is being reused? Any way to avoid the annoying quit/restart cycle I've been using to fix things?" some initial thoughts: we don't cache pop connections, so I wonder want is going on there. we might have a dns cache in netwerk (to save calls to gethostbyname()), but I'm trying to think how that would cause your problem... it might be necko, silently failing to establish the connection, or us dropping the error (which I know we do for some errors), or both. in nsMsgProtocol.cpp, see nsMsgProtocol::OnStopRequest(), where we silently drop certain errors. there's an existing bug about us doing that when you try to do pop over ssl, or nntp over ssl, and psm is not installed. brendan, can you get a NSPR log for pop? http://www.mozilla.org/quality/mailnews/mail-troubleshoot.html#pop darin might have another module for you to log, like sockettransport or something.
yeah, we don't cache pop connections. It could be the necko dns cache. I've also heard reports of this going on at an os level, but if shutting down mozilla and restarting fixes it, then that is most likely not the problem.
brendan: have you tried toggling the online/offline switch?
I don't have problems with my POP connection going between work and home on Mac OS X. Just a data point.
brendan: what OS are you running? (if linux, then what version of glibc.)
RH8, glibc-2.2.93-5. /be
Attached patch v1 patch (obsolete) — Splinter Review
i think this patch does the trick. i setup a POP server, connected to pull down my mail. then i put the POP server offline, and pressed Get Msgs. the result: the throbber would just spin indefinitely, and nothing could be done to recover from the situation. bringing the server back online and pressing Get Msgs again wouldn't help. i determined that this can happen if the socket transport enters the closed state (due to connection failure) while a notification is pending. the notification would just get dropped in this case, resulting in the error not getting propogated.
i suspect that it is easy to put mozilla in this state when you consider that we pin ip addresses. i'm thinking that when brendan comes to work, his mozilla still has the old ip address pinned. then when he hits Get Msgs, we immediately discover that there is no server listening and lose the race condition i just described.
i think bug 200181 might be a duplicate of this...
Blocks: 200181
Severity: normal → critical
Status: NEW → ASSIGNED
Component: Mail Back End → Networking
Priority: -- → P1
Product: MailNews → Browser
Target Milestone: --- → mozilla1.4beta
-> me
Assignee: sspitzer → darin
Status: ASSIGNED → NEW
Attached patch v1.1 patchSplinter Review
oops.. left some debugging crude in the last patch.
Attachment #120923 - Attachment is obsolete: true
Attachment #120924 - Flags: superreview?(bzbarsky)
Attachment #120924 - Flags: review?(dougt)
reviewers: this is the critical part of the patch: if (NS_FAILED(mCondition)) { // ignore event since we're apparently already dead. LOG((" ignoring event [condition=%x]\n", mCondition)); + // + // notify input/output streams in case either has a pending notify. + // + mInput.OnSocketReady(mCondition); + mOutput.OnSocketReady(mCondition); return NS_OK; } without this code, we have the race condition i described. the rest of the patch is mainly cosmetic.
Nit: maybe change the comment, since we're no longer (completely) ignoring the event. Logging still might be nice, but maybe it should say something a little different.
Comment on attachment 120924 [details] [diff] [review] v1.1 patch >Index: nsSocketTransport2.cpp >- if (NS_FAILED(rv)) { >- mNotify = 0; >- if (NS_SUCCEEDED(mCondition)) >- mCondition = rv; >- } >+ if (NS_FAILED(rv)) return rv; So we no longer need to update mCondition on failure here? Why not? Same for the output stream. sr=me if there is a reason; if so, comment it.
Attachment #120924 - Flags: superreview?(bzbarsky) → superreview+
gordon: good point.. thx! boris: 1) consistency with nsPipe3.cpp and 2) that failure would only indicate lack of sufficient memory, and it doesn't make any sense to alter the state of the transport as a result. the call to AsyncWait should just fail with no side-effects (hence the reason why i defer clearing the old mNotify until later).
Yeah, just put that in a nice comment. ;)
bz: you got it ;-)
Status: NEW → ASSIGNED
Attachment #120924 - Flags: review?(dougt) → review+
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: