Closed
Bug 100245
Opened 25 years ago
Closed 4 years ago
leaking nsNNTPProtocol objects when objects get interrupted
Categories
(MailNews Core :: Networking: NNTP, defect)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: sspitzer, Unassigned)
Details
(Keywords: memory-leak, Whiteboard: [patchlove][has draft patch][needs new assignee])
Attachments
(1 file)
|
665 bytes,
patch
|
hwaara
:
review+
|
Details | Diff | Splinter Review |
leaking nsNNTPProtocol objects when objects get interrupted
see bug #59449.
pressing space bar and holding it on netscape.test on news.mozilla.org, I
created 24 protocol instances, and only destroyed one.
Comment 1•25 years ago
|
||
Attaching a patch which seems to help with this problem. (I actually had this in
my local tree because rfc977 prefers sending a QUIT when closing a transaction).
Keywords: patch
Comment 2•25 years ago
|
||
Comment 3•25 years ago
|
||
All other protocols inheriting from nsMsgProtocol that implements ::Cancel calls
back to nsMsgProtocol::Cancel() ... Not sure why, but it might be a good idea to
do the same with nsNNTPProtocol.
Phil?
Comment 4•25 years ago
|
||
Håkan, you're forcing me to think about how my patch works! My simplistic
reasoning was as follows:
1) Calling nsMsgProtocol::Cancel releases the TCP connection. This is all one
needs to do to kill, for example, an HTTP transaction.
2) Calling CloseConnection sends a QUIT to the news server, which then releases
the TCP connection. This is the preferred method according to rfc977.
In both cases the TCP connection gets released. For some reason, 2) has the
pleasant side-effect of not leaking objects, but I don't know why.
Comment 5•25 years ago
|
||
Phil,
wouldn't #2 also have the unpleasant side-effect of having us quit, start, quit,
start... the connection if the user presses the spacebar to quickly switch messages?
Sounds like that would be tough for the news-server if you send QUIT like 5
times in two seconds. :)
Comment 6•25 years ago
|
||
It's tough on the news server anyway if you just lean on the space bar - each
message will require a *new* TCP connection. Don't do it :-)
Comment 7•25 years ago
|
||
Apropos leaning on the space bar - I tried this with Netscape 4.72. I was
pleased to note that this trusty newsreader sends a QUIT on every connection. It
also seems to limit the possible damage by restricting itself to a maximum of 3
TCP connections - maybe we should do the same?
Comment 8•25 years ago
|
||
Comment on attachment 49899 [details] [diff] [review]
Patch
After thorough thinking and digging, I think this patch is the right thing to do.
r=hwaara
Attachment #49899 -
Flags: review+
| Reporter | ||
Comment 9•25 years ago
|
||
> It's tough on the news server anyway if you just lean on the space bar - each
> message will require a *new* TCP connection. Don't do it :-)
there as seperate bug for fixing that badness. see #100246. we already do the
right thing (I think with a timed select) when we use the arrow keys to "zoom"
over articles in the thread pane. we need to get "n" and space to do the same
thing.
> Apropos leaning on the space bar - I tried this with Netscape 4.72. I was
> pleased to note that this trusty newsreader sends a QUIT on every connection.
yes, we definitely want to make mozilla do that. disconnecting improperly is
bad. see
http://www.newsreaders.com/misc/twpierce/news/newsreader-manifesto.html
> It also seems to limit the possible damage by restricting itself to a maximum
> of 3 TCP connections - maybe we should do the same?
yes, we want to. see bug #66150
I'll review this patch soon. I want to make sure we do the right thing when
the user actually does cancels during a news action (by using the stop button)
Updated•25 years ago
|
Updated•25 years ago
|
Priority: -- → P2
Target Milestone: --- → mozilla0.9.8
Comment 12•24 years ago
|
||
adding nsbeta1- and moving out. But if the patch is good, we should get take it.
Comment 13•24 years ago
|
||
Bienvenu or Seth, can you take a look at Phil's patch?
Comment 14•24 years ago
|
||
sometime this year would be nice, *if* you can spare the time
Updated•22 years ago
|
Product: MailNews → Core
Comment 15•19 years ago
|
||
sorry for the spam. making bugzilla reflect reality as I'm not working on these bugs. filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody
Status: ASSIGNED → NEW
Comment 16•18 years ago
|
||
should still apply with just a line number change according to Phil.
QA Contact: stephend → networking.news
Comment 17•18 years ago
|
||
Comment on attachment 49899 [details] [diff] [review]
Patch
IIRC, we still need sr by a mailnews peer...
Attachment #49899 -
Flags: superreview?(bienvenu)
Updated•18 years ago
|
Assignee: nobody → phil.anderton
Comment 18•18 years ago
|
||
this doesn't seem right - will anyone get a notification that the process was stopped, instead of completing normally? Are we sure this is still an issue? It looks to me like we call CloseConnection in the NNTP_ERROR case (though I'm not sure we'll get back into the state machine in that case).
| Assignee | ||
Updated•17 years ago
|
Product: Core → MailNews Core
Comment 19•17 years ago
|
||
hwaara, phil, any possibility for refreshed patch, or comment?
Target Milestone: mozilla1.2alpha → ---
Comment 20•16 years ago
|
||
Comment on attachment 49899 [details] [diff] [review]
Patch
clearing review request pending answers to the questions I raised a while ago.
Attachment #49899 -
Flags: superreview?(bienvenu)
Updated•14 years ago
|
Assignee: phil.anderton → nobody
Severity: normal → minor
Priority: P2 → --
Whiteboard: [patchlove][has draft patch][needs new assignee]
Comment 21•4 years ago
|
||
We have a connection pool, how many instances are created depends on max_cached_connections pref.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•