Skip to content

fix: seed rings without timing out on the biggest topic - #197

Merged
ralyodio merged 1 commit into
mainfrom
fix/ring-seed-timeout
Sep 13, 2026
Merged

fix: seed rings without timing out on the biggest topic#197
ralyodio merged 1 commit into
mainfrom
fix/ring-seed-timeout

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Seed rings without timing out on the biggest topic

Follow-up to #196. The poller deployed, applied the migration and started the ring pass, and its first seeding attempt died after 30 s with The operation was aborted due to timeout (event="rings-error", 08:52:10 UTC): Turso's per-request deadline, hit by the largest topic. topicRingCandidates range-scanned every feed_keywords row of the topic, joined, grouped and sorted them before the limit 100; topicRingSize counted the same join in full. And lastRingSeed was stamped before the call, so the next attempt was six hours away.

  • topicRingCandidates: walk feeds in admission order (feeds_created_idx) with an exists probe into feed_keywords (its primary key), so the statement stops at the hundredth member of a big topic and costs a point lookup per feed on a small one.
  • topicRingSize(db, slug, { cap }): the count stops at cap; seedTopRings passes the minimum it is asking about. Exact without a cap (the existing tests), plus a test for the cap.
  • seedTopRings: a topic that fails is counted (failed) and reported through onError; the pass continues.
  • Poller: lastRingSeed stamped after the pass; a thrown pass is retried ten minutes later; the seed tally is logged when anything was created, added or failed.

Tests: db, ingest and poller suites pass (results in the session log).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XYae2mH3khdwiXUVzcVMDw

…failed seed in minutes

The first production seed died at the request deadline on the largest
topic: the candidate query range-scanned every keyword row of the topic,
joined, grouped and sorted them, and only then took a hundred; the size
query counted the same join in full. Now both walk feeds in admission order
with a primary-key probe into feed_keywords and stop at the rows they need
(the size count stops at the minimum the caller asks about). A topic that
still fails is counted and reported and the pass moves on, and the poller
retries a failed seed ten minutes later instead of at the next six-hour
mark, which is what the first deploy would have waited.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XYae2mH3khdwiXUVzcVMDw
@ralyodio
ralyodio merged commit 2bcac96 into main Sep 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant