Commit Graph

2 Commits (be59d31de9d22a56896bf62819d68bbea0ac9731)

Author SHA1 Message Date
Ashley be59d31de9 Rebuild a missing home feed from the read that found it missing
The read path had three ways of answering a request whose window came
back empty, and all three could leave a user staring at a blank timeline.
It returned early whenever the set had any members, so a feed full of
unresolvable ids never got looked at. It only attempted a rebuild for a
request that sent no cursor, so a client holding a cursor got nothing on
every retry. And it marked the rebuild as done before knowing whether it
had worked, in a key nothing ever evicted, so a warm that threw
suppressed the next five minutes of attempts, and the throw itself
escaped the synchronous dispatch and turned the response into a 500.

A missing cached set is now rebuilt in-request behind a non-blocking
30-second lock: a reader that loses the lock serves nothing rather than
running a second full warm, one that wins releases it in a finally, and a
warm that throws is logged and leaves the feed eligible for the next
request. The page is then re-read through the same window helper, so the
cursor the client sent survives the rebuild. The rebuild goes 100 members
deep and queues the deepening job only when it filled that depth.

Three existing cases asserted the old bookkeeping rather than the
behaviour it was meant to protect. They keep their 200s and their empty
bodies and now assert the single-warm guarantee directly.
7 days ago
Ashley dda3ae7846 Serve the home feed with 200 after a synchronous cold warm
A cold home feed warmed synchronously on the request thread but always
returned 206 with an empty body, so a user whose feed warmed to real
content got nothing until a retry, and a user following only post-less
accounts was stuck on 206 indefinitely. The warm completes before the
response, so read the freshly warmed set and return it with 200, or 200
with an empty array when there is genuinely nothing to show.
2 weeks ago