[Fontconfig-bugs] [Bug 100096] fontconfig update racy, causes update storm that freezes the desktop

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jul 31 15:17:25 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=100096

--- Comment #3 from Jan Alexander Steffens (heftig) <jan.steffens at gmail.com> ---
(In reply to Akira TAGOH from comment #1)
> Maybe not possible. that is why this is racy. one who knows the targeted
> directories is updated is only one or a few where is kicking updates. but it
> isn't necessarily true that the updated caches contains the updates coming
> during updating.

I wasn't looking for a perfect solution. Note that in my tests I was only
touching one directory twice within 100ms, yet every process loading fontconfig
insisted on regenerating the cache for this directory in sequence, taking over
two minutes in total. The second regeneration should have been the last (for
the latter change), but it wasn't.

> If the updates on fonts directories is often happening, maybe good to
> increase the rescan interval in the config to check.

I think this would make it happen less often, but still just as badly.

> other option is to
> implement a feature stops updating caches in fontconfig during loading
> caches. this will prevents unexpected freeze on runtime. but someone needs
> to take care of the outdated caches instead of fontconfig and re-create
> caches as needed then.

Right. The perfect solution for me would be:

- libfontconfig only watches config and caches for changes, never font dirs
- system caches are only ever regenerated manually (e.g
 via package manager)
- user caches are regenerated manually or by gnome-settings-daemon when user
fonts change

This should totally avoid unexpected stalls because the applications do not
attempt to scan the fonts. However, I don't know how to deal with apps that
need older cache versions not produced by the system.

Another mitigation approach would be doing the scanning asynchronously, in a
worker thread.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig-bugs/attachments/20170731/03aec588/attachment.html>


More information about the Fontconfig-bugs mailing list