Skip to content

Serve stale entries, and say that they are stale #43

Description

@iderex

A cache that only ever returns fresh entries is a cache that is empty exactly
when it is needed, which is when the server is slow or gone. A cache that returns
stale entries without saying so makes every caller guess.

What this produces

Every read answering with the entry and its age, so a caller can decide.

A way for a caller to demand a fresh answer and to accept the failure that comes
with it, used by the paths where staleness is wrong.

The freshness rules from the contract in #6 applied per kind of entry rather than
globally, since a library list and a playback position go stale at very different
speeds.

What happens when the server says an entry has changed is #116 rather than this
issue, which holds only the age a reader is given and the freshness rules that
age is read against.

Done when

Every read returns the age alongside the value, a test proves a demand for
freshness fails rather than returning a stale entry when the server is
unreachable, and each kind of entry has its freshness rule stated in one table.
Blocked on #6, #40, and #102 for what an entry's age is measured against, so
that an entry cannot become permanently fresh because a clock moved between the
write and the read.

Metadata

Metadata

Assignees

Labels

architectureShape of the core: boundaries, interfaces, contractsblocked-on-issueWaits on another open issue on this board

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions