Closed Bug 1800202 Opened 3 years ago Closed 2 years ago

(Re-)building folder cache leads to MSF deletion

Categories

(MailNews Core :: Database, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr102+ fixed, thunderbird108 affected)

RESOLVED FIXED
109 Branch
Tracking Status
thunderbird_esr102 + fixed
thunderbird108 --- affected

People

(Reporter: b5, Assigned: mkmelin)

Details

Attachments

(2 files)

Attached file Local Folders.7z

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Steps to reproduce:

In the past, deleting panacea.dat led to a mass deletion of MSF files since for rebuilding the folder cache, too many MSF files were opened at once. This is well-known, see bug 1093217 comment #5. (Truncated to null bytes was a no-longer-existing side effect of a missing MSF being replaced with an empty file, see bug 1724849.)

This hasn't changed with the new folder cache. Drop the attached 910 (1 + 9 + 90 + 810) folders into "Local Folders" and start a debug version of TB. You can see mork asserts about not being able to open the databases. This happens while updating the folder cache with the new folders.

You can also see it by switching on the "Total" in the folder pane columns. The correct totals of 90 are only show for the first six or seven top level folders.

Note that the 910 folder example was prepared by bugzilla@arge-metallguss.de for bug 1554188.

Confirming based on reporter's comment 0.
Looks like a serious enough architectural problem which we should address - just having lots of folders is not a very extraordinary scenario, but may happen quite easily over time wrt archiving etc.

Magnus, who can fix this?
Can we use the patch linked in comment 1 to fix this?

Severity: -- → S2
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mkmelin+mozilla)

There are more issues in this area, see bug 1795178 comment #1.

(In reply to Thomas D. (:thomas8) from comment #2)

Can we use the patch linked in comment 1 to fix this?

Seems we could.
Apply the patch from bug 1787609 and the patch from comment 1 on top.
Ben, perhaps reconsider taking the patch in bug 1787609 unless bug 1795178 is likely to see a quick resolution

Flags: needinfo?(mkmelin+mozilla) → needinfo?(benc)

(In reply to Magnus Melin [:mkmelin] from comment #4)

(In reply to Thomas D. (:thomas8) from comment #2)

Can we use the patch linked in comment 1 to fix this?

Seems we could.
Apply the patch from bug 1787609 and the patch from comment 1 on top.

Yeah, seems like the prudent thing to do in the interim.
Sorry - I should have been more open to a short-term fix earlier.

Flags: needinfo?(benc)

This is run from discoverFolders() at startup and can cause MSF loss if too many folders are left open.

Depends on D162520

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/fd0e7ca7df18
Close db after use in nsMsgDBFolder::ReadDBFolderInfo(). r=benc

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch

Comment on attachment 9304374 [details]
Bug 1800202 - Close db after use in nsMsgDBFolder::ReadDBFolderInfo(). r=benc

[Approval Request Comment]
User impact if declined: can help some with .msf problems
Testing completed (on c-c, etc.): beta
Risk to taking this patch (and alternatives if risky): should be safe

Attachment #9304374 - Flags: approval-comm-esr102?

Comment on attachment 9304374 [details]
Bug 1800202 - Close db after use in nsMsgDBFolder::ReadDBFolderInfo(). r=benc

[Triage Comment]
Approved for esr102

Attachment #9304374 - Flags: approval-comm-esr102? → approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: