wiki.techinc.nl/tests/phpunit/unit
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
..
documentation Merge "Add composer releasenotes command" 2021-12-23 17:43:34 +00:00
includes Support stale cached settings for failover 2022-01-21 13:31:09 -08:00
languages Add missing @param and @return to documentation in tests 2021-01-22 19:57:25 +01:00
maintenance Move MWDoxygenFilterTest to unit tests 2021-03-28 18:33:51 +00:00