Skip to content

crawler: 10 s fetch budget, 30-day flag for slow/broken feeds, dead rechecked monthly - #275

Merged
ralyodio merged 1 commit into
mainfrom
crawl-10s-30s-30d
Nov 8, 2026
Merged

ralyodio merged 1 commit into
mainfrom
crawl-10s-30s-30d

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Implements the fleet crawler rule (2026-11-08) for the feed poller.

  • CRAWL_FETCH_TIMEOUT_MS = 10_000 (was 15 s) covering DNS + connect + headers + body; thrown errors classified into timeout / dns-failed / tls-failed / connection-failed / fetch-failed (dns-retry for EAI_AGAIN stays on the short ladder).
  • Timeout, DNS, TLS, connection and 5xx failures now set next_fetch_at = now + 30d (last_error + error_count recorded, the feed's interval kept). 4xx / no-feed-found keep the 1h..1d ladder.
  • dead is no longer forever: recheckFeeds() (partial index feeds_recheck_idx) hands due dead feeds to dueFeeds (5% share + slack); one recheck per 30 days, success restores active. Migration re-stamps existing dead feeds to last_fetched_at + 30d.
  • 429 Retry-After handling unchanged (capped at 1 day).

Tests: packages/feed/test/crawl-timeout.test.js, packages/ingest/test/recheck.test.js, recrawl + db tests updated. Full suite green locally on Node 22.

🤖 Generated with Claude Code

…is not forever

Fleet crawler rule (2026-11-08):
- CRAWL_FETCH_TIMEOUT_MS = 10_000 in packages/feed/src/fetch.js replaces the
  15 s literal; the deadline now starts before DNS so lookup + connect +
  headers + body share one budget.
- Thrown fetch errors are classified (timeout, dns-failed, tls-failed,
  connection-failed, fetch-failed); a name that does not resolve is
  dns-failed, no longer blocked-host. EAI_AGAIN is dns-retry and keeps the
  short ladder so a resolver hiccup cannot park the directory for a month.
- crawlFeed: timeout / DNS / TLS / connection / 5xx failures set
  next_fetch_at = now + 30 days (last_error, error_count recorded, feed
  interval kept). 4xx and no-feed-found keep the 1h..1d ladder.
- 'dead' (10 failures) is rechecked every 30 days: recheckFeeds() reads
  status='dead' rows past next_fetch_at (new partial index
  feeds_recheck_idx), dueFeeds offers them a 5% share plus any slack, a
  success restores the feed to active. Migration re-stamps existing dead
  feeds to last_fetched_at + 30 days.
- 429 / 503+Retry-After handling unchanged (capped at a day).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit f6b4cfa into main Nov 8, 2026
3 checks passed
ralyodio added a commit that referenced this pull request Nov 8, 2026
Follow-up to #275. 721 dead feeds were retired by older rules with fewer
than ten failures (garbage URLs, not-a-hostname); a failed recheck
recomputed status from error_count and downgraded them to 'error', putting
them back in listings and on the 1h..1d ladder. markCrawlFailure now keeps
'dead', and crawlFeed waits 30 days for any dead feed (status is in
DUE_COLUMNS).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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