Closed
Bug 511609
Opened 16 years ago
Closed 16 years ago
leak-avoiding nulling of nsIMsgFolder.msgDatabase kills message db enumerators, breaks gloda indexing
Categories
(MailNews Core :: Database, defect)
MailNews Core
Database
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 3.0b4
People
(Reporter: asuth, Assigned: Bienvenu)
References
Details
(Whiteboard: [no l10n impact])
Attachments
(2 files)
|
4.11 KB,
patch
|
asuth
:
review+
standard8
:
superreview+
|
Details | Diff | Splinter Review |
|
1.42 KB,
patch
|
asuth
:
review+
|
Details | Diff | Splinter Review |
We current null out the msgDatabase on nsIMsgFolders all over the place to avoid ending up with all the folders open at the same time.
Unfortunately, this operation is more annoying than initially believed. nsMsgDBFolder::SetMsgDatabase(null) calls nsMsgDatabase::ClearCachedHdrs() which calls nsMsgDatabase::ClearCachedObjects(PR_FALSE). That dude kills all outstanding enumerators. Because of how fixIterator works, gloda sees this as a normal termination and assumes it is done with the folder.
http://mxr.mozilla.org/comm-central/source/mailnews/base/util/nsMsgDBFolder.cpp#950
At the least, I propose we only kill enumerators when dbGoingAway. We might also be able to just stop calling ClearCachedHdrs().
Gloda would probably benefit from being more suspicious of the enumerator too, but we definitely need this failure case eliminated.
Flags: blocking-thunderbird3?
| Assignee | ||
Comment 1•16 years ago
|
||
I can look at this...it may be a bit more complicated because of the tangled reference web between the hdrs and the db - I think we will need to call ClearCachedHdrs.
Assignee: nobody → bienvenu
Flags: blocking-thunderbird3? → blocking-thunderbird3+
| Assignee | ||
Comment 2•16 years ago
|
||
I haven't looked at the gloda unit tests - I assume I could insert a folder.msgDatabase = null line in there somewhere and verify that indexing continues. I'll go look for a nice place for that...
Attachment #395733 -
Flags: superreview?(bugzilla)
Attachment #395733 -
Flags: review?(bugmail)
| Reporter | ||
Comment 3•16 years ago
|
||
Comment on attachment 395733 [details] [diff] [review]
proposed fix
Thank you for the speedy turnaround.
Probably the easiest way to inject the fault is to add logic to glodaTestHelper.js' messageCollectionListener. It gets hooked up to a wildcard collection that gets notified about every new message as it gets indexed. So if you just have a flag (possibly global) that nulls out GlodaIndexer._indexingFolder.msgDatabase and clears the flag, that should work.
Attachment #395733 -
Flags: review?(bugmail) → review+
Updated•16 years ago
|
Attachment #395733 -
Flags: superreview?(bugzilla) → superreview+
Comment 4•16 years ago
|
||
Having a test for this would definitely be a good idea.
Flags: in-testsuite?
Updated•16 years ago
|
Whiteboard: [no l10n impact]
| Assignee | ||
Comment 5•16 years ago
|
||
With this patched test case, gloda tests w/o the fix fail, and succeed with.
If we want, we could do a mod instead of a comparison to test clearing the db at regular intervals, which is why I used a counter.
Attachment #395857 -
Flags: review?(bugmail)
| Assignee | ||
Comment 6•16 years ago
|
||
patch checked in - I'll land the test case once it passes review.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 7•16 years ago
|
||
Comment on attachment 395857 [details] [diff] [review]
tweak gloda tests to simulate bug
Thanks for the test!
Attachment #395857 -
Flags: review?(bugmail) → review+
You need to log in
before you can comment on or make changes to this bug.
Description
•