Closed Bug 74518 Opened 24 years ago Closed 24 years ago

reading news messages (or attachments) from the memory cache leaves connections as "busy" causing us to open too many nntp connections

Categories

(MailNews Core :: Networking: NNTP, defect, P1)

x86
All
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: mozilla, Assigned: sspitzer)

References

Details

(Whiteboard: [PDT+] sr=mscott; r=naving, a=chofmann critical for 0.9.2)

Attachments

(2 files)

A while back there was a bug when attachments were downloaded multiple times: once when the message was displayed, and once when the inline attachment was being displayed. Now that the "too many connections" bugs have been cleared up, and i can finally use news, this bug has become very noticable. Whenever someone tries to save a news attachment, that attachment is downloaded from the server again. This would be a serious performance problem for people on dialup connections. If we use the cache to hold the attachment while we view the message (as was the case in the previous bug) why can't we use the cached copy when we save the attachment. This should make news appear noticably faster, and will prevent any more problems with "busy" connections. This bug seems to olny affect when you save the attachment from the paperclip button/menu. If you right click and save-as, you get a download window which completes almost instantly (of course you lose the attachment name) Also, shouldn't the saving attachment be done in a more obvious a manner than simply starting the progress bar with "loading" ?
I think this is fixed when bug 73819 is checked in...thoughts?
I was not aware of bug 73819 but I don't think this will be fixed then either. CCing mscott@netscape.com since he is assigned the "attach cache to news" bug. The problem in that bug is to convert all of the current cache uses over to the new cache. This is just informing people that a new use exists for the cache. Lets not close this bug until we find out whether attachments will be saved from the cache - new or otherwise.
Build ID: 2001052420, Windows 2000. I can read articles no problem (re: bug 65927) but if I save an attachment, bam! After that, I get the "too many open connections" error dialog when attempting to read another article. Saving the attachment is apparently using another connection and then not releasing it. I am using the right-click context menu and not the paper clip. - Kyle
Marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
*** Bug 86183 has been marked as a duplicate of this bug. ***
updating. not going through the cache is one thing, leaving open connections is another.
Status: NEW → ASSIGNED
Priority: -- → P1
Summary: saving news attachments causes them to be downloaded again. → saving news attachments leaves open nntp connections & causes them to be downloaded again.
Target Milestone: --- → mozilla0.9.2
this is valid. I was able to read 11 messages and save 11 attachments and end up with 11 new nsNNTPProtocol instances. debugging now...
interesting, saving the attachments doesn't cause us to spin up a new connection. right now, it looks like using a connection to save an attachment renders that connection "busy". so, the next time we need a connection, all the ones in the connection cache are busy, so we create a new one. (there's already another bug about changing the code so we queue up the requests we can't handle, instead of creating a new protocol instance.) debugging more...
when reading from the cache, set the connection as busy, but never unset it when we are done. testing a potential fix...
so far, that patch address the problem of too many connections. but, I'm noticing that after I save an attachment, we're closing the nntp connection (instead of keeping it open.) I'll investigate that...
ah, I think I know it looked like we were closing the connection. we're not updating the m_lastActiveTimeStamp on the connection when we reuse it (when getting the attachment out of the cache). but that's correct, since we shouldn't be updating that unless we go over the wire and talk to the server. I need to double check that we are not hitting the server when reading the attachment out of the cache. so, when I was debugging, I was taking long enough so we'd hit the inactivity limit and rightly take the connection out of the connection cache. I'll double check to make sure, and report back.
I may also see why we go to the network for the first attachment in the message, but not the second (if there is one.) when we load the message, we ask the server for it by article num, not message id. when we ask for the attachment, we ask for it by message id (and part #). we need to make sure that even if we ask for the message by article num, we stuff it in the memory cache by id. but I need to debug and verify. that will be a seperate bug (about going to the server for attachments we've already downloaded.) this bug will cover the problem of leaving open attachments. tomorrow I'll verify my fix is correct.
this fix is not correct, I'm still seeing us open too many connections. I'll continue to work on it tomorrow.
actually, it does address the problem. I'm ending up with no more than 3 connections open at time, but there are a lot of connections that get opened, never get used, and get closed down. I need to learn more about how the memory cache works. I'll attach a new patch that is the old patch, plus some improvements to the NNTP logging that is helping me figure out what's going on.
moving to 0.9.3
Target Milestone: mozilla0.9.2 → mozilla0.9.3
actually, we look protocol instances every time you read a message in the cache. my initial fix (which is the same as my second patch, just no logging changes) is the right way to fix this. moving back to 0.9.2, since fix in hand for a bad problem. there are some other issues, but I'll log them as additional bugs.
Target Milestone: mozilla0.9.3 → mozilla0.9.2
updating summary.
Summary: saving news attachments leaves open nntp connections & causes them to be downloaded again. → reading news messages (or attachments) from the memory cache causes us to open too many nntp connections
looks great to me. this definetly looks like a .0.9.2 stopper. Adding some more keywords to get on PDt's radar too. sr=mscott
Keywords: nsbeta1
Whiteboard: [PDT+]
Whiteboard: [PDT+] → [PDT+]patch available
the original bug (saving attachments doesn't go through the cache) is valid, I'll log up a new bug on that. there's also another problem where we open the network socket too early, I'll log a new bug on that.
Summary: reading news messages (or attachments) from the memory cache causes us to open too many nntp connections → reading news messages (or attachments) from the memory cache leaves connections as "busy" causing us to open too many nntp connections
Whiteboard: [PDT+]patch available → [PDT+] sr=mscott; r=??
makes sense to me; r=naving
updating status
Whiteboard: [PDT+] sr=mscott; r=?? → [PDT+] sr=mscott; r=naving, a=?
a=chofmann
fixed. I'll go open those other 2 bugs I mentioned.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: [PDT+] sr=mscott; r=naving, a=? → [PDT+] sr=mscott; r=naving, a=chofmann
QA Contact: esther → stephend
Whiteboard: [PDT+] sr=mscott; r=naving, a=chofmann → [PDT+] sr=mscott; r=naving, a=chofmann critical for 0.9.2
spun off bugs #87344 and #87347
Over to my AT&T broadband account, where this could be verified from.
QA Contact: stephend → stephen.donner
I believe I can verify this fixed, as I can save news messages without getting that dreaded "too many connections" dialog. However, I am CCing kyles@pobox.com since he also saw this bug. I'm marking it verified, but if anyone sees saving messages (or attachments) leaving connections as busy, please reopen. Remember that saving the attachments themselves requires a new connection (bug 87344) and just viewing attahments from the cache gets another connection as well (bug 87347) At least now they're not left as busy :-)
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: