Open Bug 717016 Opened 13 years ago Updated 2 years ago

pending URI queue management is problematic

Categories

(MailNews Core :: Networking: NNTP, defect)

x86_64
Windows 7
defect

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: jcranmer, Assigned: jcranmer)

References

Details

(Keywords: perf)

While debugging bug 695309, I discovered that we have some serious issues with pending URI queue, particularly in the face of unexpected connection interruptions. Bug 695309 is itself the primary symptom of this issue, and the patch on said bug is only a band-aid which prevents the problems from causing severe pain. My basic proposal is to use the following notes for the connection queue: 1. If a connection is closed, we should have some logic to see if reopening the connection to run URIs is feasible. 2. If a connection is closed, we should attempt to re-run the URI on another connection. 3. Timeouts should be handled differently: we should first see if the socket is probably usable and timeout if the socket was closed by the other end, instead of assuming that 3 minutes is an automatic timeout. 4. Standard newsgroup updates should not be allowed to take over all of the connections, and probably should be limited to 1 or 2 connections. 5. If a request for a URI comes into the queue, and it is already present, we should consolidate them to one request (and probably move it to the head, unless it's a get-new-messages request).
So the implementation I'd like to see here would use nsISocketTransport::IsAlive, which is documented as being threadsafe but actually isn't. Since NNTP does everything on the main thread for now at least, would it actually be safe to use this?
(In reply to Joshua Cranmer [:jcranmer] from comment #1) > So the implementation I'd like to see here would use > nsISocketTransport::IsAlive, which is documented as being threadsafe but > actually isn't. Since NNTP does everything on the main thread for now at > least, would it actually be safe to use this? Brian would know for sure...
The short answer I got from Brian over IRC is that it is safe to call ::IsAlive on the thread that is doing the I/O, which in this case is the main thread.
Keywords: perf

So this is a problem for news, and does not extend to imap?

Flags: needinfo?(Pidgeot18)

I wonder if it applies to this bug where it it referenced here: bug 538375 comment 25 ?? When copying emails between servers I see append command seem to not be put in the url queue and the copy stops before all selected emails are copied. This is with imap.

(In reply to Wayne Mery (:wsmwk) from comment #5)

So this is a problem for news, and does not extend to imap?

NNTP and IMAP use entirely different systems for handling their network requests (and of course, POP, SMTP, local messages, and movemail all have their own unique ones as well!).

Flags: needinfo?(Pidgeot18)

To what extent will this have been affected by Bug 1719413 - Implement nsINntpService in JavaScript ? (fixed in version 92)

Flags: needinfo?(Pidgeot18)
Flags: needinfo?(Pidgeot18)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.