Closed Bug 1822265 Opened 3 years ago Closed 1 year ago

Thunderbird 102.8.0 hangs on startup due to calendar-data/cache.sqlite queries piling up

Categories

(Calendar :: General, defect)

Thunderbird 102
x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jwkbugzilla, Unassigned)

Details

(Keywords: perf, Whiteboard: [closeme 2024-12-10])

I could no longer start Thunderbird with calendars enabled, presumably since upgrading to 102.8.0 (on Fedora 37). I’m not sure what the version was before upgrade but I don’t think it was older than 102.6.0. The hang happened after entering the master password, before the UI showed up. This is similar to bug 1776218 but with a different root cause.

Profiling and debugging doesn’t seem possible so early during startup, but I could find the problematic code path by instrumenting the code. The calls to CalStorageItemModel.getAdditionalDataForItem() take a very long time, progressively so.

Database access is very slow for some reason. If I time this.db.executeAsync(selectItem), these are the times I get:

56 56 56 56 60 60 90 111 131 150 170 170 190 212 232 249 270 287 307 327 348 367 366 387 403 426 442 463 480 501 524 545 561 582 598 620 639 638 26 26 25 24 24 23 52 76 96 4176 4176 4192 7965 11761 22018 27107 27107 27129 32249 37080 43094 49197 54913 60668 61721 57962 54197 49033 44011 38947

Times get smaller at some point, indicating that locking isn’t the issue and requests started later sometimes manage to finish earlier. Altogether, this takes an awfully long time however and I didn’t have enough patience to let it finish.

My cache.sqlite file is 11 MB in size. The table cal_events has 3575 entries, cal_attendees has 3578 entries. I tried importing the data into a fresh database, suspecting that it might be corrupt – this brought the size down to 9 MB but did not improve the situation. Removing the cache fixed this however.

Just in case this is relevant, it’s a remote calendar with Google Calendar as provider.

After resynchronizing I have a 6 MB cache.sqlite file with 2651 cal_events and 2654 cal_attendees entries. The issue is still gone. I cannot see any obvious differences between the dumps of the old and the new cache.sqlite file, other than the latter being only half the size.

Keywords: perf

Wladimir,
Have you seen this in newer versions of Thunderbird?

Flags: needinfo?(jwkbugzilla)
Whiteboard: [closeme 2024-12-10]

Wayne, it’s not like I’ve been banging my head against this issue for the past two years. As I said, re-creating the cache fixed the issue and it didn’t come back. At some point I gave up on calendars in Thunderbird, not sure how long exactly I kept using this feature after filing this bug.

Flags: needinfo?(jwkbugzilla)

Thanks for the update.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.