Fontconfig makes sure cache files are ''up to date'' by comparing the timestamp of the cache file with the timestamp of the related directory, if the cache is no older than the directory, then things are ''fine''. This works correctly when the directory and cache timestamps are under the control of the same machine. Leave the directory timestamp to another machine and things get broken if the two machines are not tightly synchronized in time. All too often, NFS has this problem. As a fix, I propose writing the directory time into the cache file and just comparing for equality. That seems far more reliable to me. This will invalidate all existing cache files though, as the cache file format will change. Anyone have concerns about this plan? -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20070724/f53282b2/attachment.pgp
On Tue, 24 Jul 2007, Keith Packard wrote:> Fontconfig makes sure cache files are ''up to date'' by comparing the > timestamp of the cache file with the timestamp of the related directory, > if the cache is no older than the directory, then things are ''fine''. > > This works correctly when the directory and cache timestamps are under > the control of the same machine. Leave the directory timestamp to > another machine and things get broken if the two machines are not > tightly synchronized in time. All too often, NFS has this problem. > > As a fix, I propose writing the directory time into the cache file and > just comparing for equality. That seems far more reliable to me. > > This will invalidate all existing cache files though, as the cache file > format will change.Why will invalidate existing cache files? Can it use existing cache files as-is (if they don''t have the directory time recorded) and if timestamp of the cache file is older than the timestamp of the related directory, then recreate the cache file using the new format (add the directory time into the cache file)? Also, for those who do use NFS, let them continue to suffer until they regenerate their own caches. But once regenerated it will have the directory time included in the cache file from then on. Or are you saying adding the directory time to the cache file will corrupt it for old libfontconfig?> Anyone have concerns about this plan?Jeremy C. Reed
On Wed, 2007-07-25 at 14:40 -0500, Jeremy C. Reed wrote:> Why will invalidate existing cache files?Because fontconfig will not support multiple cache file formats. That''s really nasty.> Or are you saying adding the directory time to the cache file will corrupt > it for old libfontconfig?Each version of fontconfig supports only one cache file format, so the new version will use new cache files while the old one uses old cache files. -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20070725/40aaa2d1/attachment.pgp