mirror of
https://github.com/mailscope/kumomta.git
synced 2026-08-21 20:08:18 +00:00
f92df0fca0
This is paired with a corresponding field in the memoize options struct, which is in turn exposed to the shaping helper shaping_data cache via the `allow_stale_shaping_data` field. The effect of setting this to true is: * Undoes the effect of invalidate_with_epoch, as stale reads cannot be epoch based * If a semaphore wait times out, and a stale value was present in the cache, that stale value will be returned to the caller To facilitate this behavior, the lruttl cache introduces a new state for a cached value: `Refreshing`, which is a combination of both `Present` and `Pending`. When stale reads are allowed, we take care to avoid unilaterally replacing `Present` with `Pending` when an item has expired. Whenever we satisfy a lookup with a stale value, we will bump a new lruttl_stale_count counter for that cache. Previously, we would classify those as errors. Something else that changed as part of this commit, is that we now set an overall deadline for the semaphore wait operation; previously, each wait would allow for up to the specified semaphore timeout, but now the total wait time for that lookup will be bounded to the specified timeout.