Open Bug 1678802 Opened 5 years ago Updated 28 days ago

Calendar freezes Thunderbird when syncing (and very slow) CalDAV calendar

Categories

(Calendar :: Provider: CalDAV, defect)

Thunderbird 78
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: iyanmv, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

(Keywords: dupeme, perf)

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0

Steps to reproduce:

I notice that sync of the same CalDAV from Thunderbird 68.x (with Lightning extension) to latest Thunderbird 78.x release is way slower. From few seconds to about 10-15 minutes. Calendar contains many events and that may show a bug unnoticed for other people syncing smaller calendars.

  1. Install Thunderbird 68.12.1
  2. Install Lightning add-on
  3. Add CalDAV calendar. I am using one provided by the SOGo (https://sogo.nu/) server of my university.
  4. Test a bit (read results below)

Later:

  1. Install latest Thunderbird 78.5.0 (although same issue in earlier releases of 78.x, at least I can confirm from 78.4.x)
  2. Add same CalDAV calendar
  3. See results below

Actual results:

In the case of Thunderbird 68.x + Lightning add-on, calendar syncs almost immediately. It only takes few seconds and Thunderbird does not freeze.

With Thunderbird 78.5.0 and earlier 78.4.x releases, events are imported one by one (or they start to appear one by one), and Thunderbird freezes to the point that it becomes unusable until sync finishes. This takes about 10-15 mins. On error console there are multiple warnings of the same type involving to mentions of CalIcsParser.jsm. I copy here one of them as example:

Lightning: Parsing failed for parts of the item (while this is considered to be a minor issue, we continue processing the item):
BEGIN:VCALENDAR
PRODID:-//Apple Inc.//Mac OS X 10.8.4//EN
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
CREATED:20130618T120828Z
UID:01D24993-2076-4DB5-9FA3-0DF5F69DB83F
DTEND;VALUE=DATE:20140312
TRANSP:TRANSPARENT
SUMMARY:5.-11. März: Zahnärztliche Vorprüfung 2014
DTSTART;VALUE=DATE:20140305
DTSTAMP:20131011T145140Z
SEQUENCE:6
BEGIN:VALARM
X-WR-ALARMUID:687E8B27-F328-4B1E-8189-0DC63916AB16
UID:687E8B27-F328-4B1E-8189-0DC63916AB16
TRIGGER;VALUE=DURATION:-PT15H
X-APPLE-DEFAULT-ALARM:TRUE
ATTACH:Basso
X-LIC-ERROR;X-LIC-ERRORTYPE=PARAMETER-VALUE-PARSE-ERROR:Got a VALUE parameter with an illegal type for property: VALUE=URI
ACTION:AUDIO
END:VALARM
END:VEVENT
END:VCALENDAR

It looks that every single event triggers this error with the same "Got a VALUE parameter with an illegal type for property: VALUE=URI" message.

Expected results:

I expect Thunderbird 78.x to work as fast as Thunderbird 68.x + Lightning add-on.

One more thing, when using the WebDAV-ICS-URL instead of the CalDAV-URL, and adding an iCalendar instead of CalDAV, it looks like there is no issue.

I am also seeing this on the latest Thunderbird v91.
The entire UI of Thunderbird freezes up during synchronization. I've also noticed that marking tasks as completed takes a few seconds instead of being almost immediate.

See Also: → 1735362

Exactly the same here with Thunderbird 78.14.0 under Debian stable and CalDAV access of some Nextcloud servers as well as ICS URL ones.
Not only the interface is slow but the synchronization process, which is a real trouble when sharing calendar with others.

Blocks: 441710
Keywords: dupeme, perf

Just confirming that this is still an issue on v109.0b3
At the top of every minute, the calendar seems to refresh which often causes a few seconds where no tasks are visible (see attached screenshot).

This is probably normal, but I do receive a bunch of "MaxOccurrence" warnings after each calendar refresh. The warnings reference tasks that have a reoccurring task with no end date.

I was able to use the performance profiler to capture the exact time-frame when the issue occurs. Hopefully this helps!
https://profiler.firefox.com/public/kybj265w9k4kbzdx8sypv6j6wcrjbcps2gbz2yr/calltree/?globalTrackOrder=01&thread=0&v=8

Also for reference, the reminders dialog also goes blank when this issue occurs.
This can be confusing because it sometimes causes the reminder window to be brought to the front even though it's empty (See Attached)

A while ago, as part of #1775032 (which seems related but just got closed), I posted a performance profile:

https://share.firefox.dev/44XvCfg

Actions carried out were:

  • Change to Calendar tab
  • Start recording
  • Flip two months back, wait for the screen to react, then two more months
  • Capture recording and upload

Going one month back would immediately freeze up the UI for a few seconds; this should be visible in the performance profile.

I am seeing the same thing here (since at least TB 102 and at least throughout 115 on Ubuntu MATE, see #1816237). Freezes are random and can happen at any point in the UI (e.g. when reading/writing email), but I can provoke them by initiating a CalDAV transaction, such as synchronizing or marking a task complete. When the UI freezes while composing a message but I continue typing, the typed text eventually appears when the screen unfreezes.

I just did another test: if I hide the CalDav calendar, I can flip through the calendar with no noticeable delays. With the CalDav calendar visible, each flip comes with a delay of several seconds.

So, it is still an issue (and quite a crippling one at that, for those affected), and apparently the CalDAV connection is what causes the delay.

(In reply to Michael von Glasow from comment #7)

...
I just did another test: if I hide the CalDav calendar, I can flip through the calendar with no noticeable delays. With the CalDav calendar visible, each flip comes with a delay of several seconds.

So, it is still an issue (and quite a crippling one at that, for those affected), and apparently the CalDAV connection is what causes the delay.

Thanks for the update.

When using version 128, does this still reproduce for you?

Flags: needinfo?(iyanmv)

It might take me some time to test that. Ubuntu 22.04 (which I use) still has 115, don’t know when they’ll offer the 24.04 upgrade to LTS users. As soon as I’m on 128+, I’ll let you know. If anyone else has a chance to test this in the meantime, feel free.

Re Ubuntu upgrades, the 24.04 rollout is taking longer due to issues with the upgrade tool, see https://askubuntu.com/questions/1525863/do-release-upgrade-from-22-04-lts-to-24-04-lts-still-no-update-available

Finally managed to upgrade to Ubuntu 24.04, which now has Thunderbird via snap, currently at 128.4.1esr. I briefly tested the issue by scrolling though the months in Calendar. There is still some delay (~1–2 seconds), but a lot more responsive than it was before.

After some more testing, including editing tasks, I notice that the delay is significantly shorter (up to ~10–15 seconds), but it is still there.

I strongly recommend getting any and all network operations off the UI thread. (Android even enforces that on its apps; any app targeting a recent version of Android will get killed by the OS as soon as the UI thread initiates a network operation.) It does make the code slightly more complex, but it improves responsiveness of the UI.

Michael,
Please obtain a performance profile https://support.mozilla.org/en-US/kb/profiling-thunderbird-performance
Thanks

Flags: needinfo?(michael)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: