[Fontconfig] Cache timestamping vs NFS

Jeremy C. Reed reed at reedmedia.net
Wed Jul 25 12:40:54 PDT 2007


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


More information about the Fontconfig mailing list