wiki.techinc.nl/includes/Settings/Source
Dan Duvall a824da0f34 Support stale cached settings for failover
Require a `CacheableSource` implementation to signal whether stale
settings may be served from the cache by implementing an
`allowsStaleLoad()` method. This will be useful for sources (e.g. etcd)
that expect some degree of unavailability and failover during
unavailability is desired.

In order to support stale results, `CachedSource` sets cache items with
an indefinite TTL but uses the computed expiry timestamp in the envelope
to consider whether the item is considered expired as opposed to a true
miss where the item is malformed or not present in the cache store.  If
a `SettingsBuilderException` is thrown during the source's `load()`
method but the cache check was not a real miss, the stale cached results
are returned.

Note there is currently no pruning of cache items so it is advised that
`CacheableSource` implementations for which stale loads are allowed also
implement an immutable `getHashKey()` based on constructor arguments.

Bug: T296771
Change-Id: Ida0698a237dc0939230799700b6f54956f033d50
2022-01-21 13:31:09 -08:00
..
Format
ArraySource.php Cache loading of SettingsBuilder sources 2021-11-29 12:54:59 -08:00
FileSource.php Support stale cached settings for failover 2022-01-21 13:31:09 -08:00
PhpSettingsSource.php SettingsBuilder: load settings recursively 2022-01-18 21:51:35 +01:00
SettingsFileUtils.php SettingsBuilder: load settings recursively 2022-01-18 21:51:35 +01:00
SettingsIncludeLocator.php SettingsBuilder: load settings recursively 2022-01-18 21:51:35 +01:00
SettingsSource.php