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 |
||
|---|---|---|
| .. | ||
| Format | ||
| ArraySource.php | ||
| FileSource.php | ||
| PhpSettingsSource.php | ||
| SettingsFileUtils.php | ||
| SettingsIncludeLocator.php | ||
| SettingsSource.php | ||