Repository navigation
Conversation
Signed-off-by: Nik Cubrilovic <[email protected]>
|
Reviewed the diff. The logic is conservative where it matters, since any doubt resolves to "live". The liveness verdict is a pure function with an injectable environment and a thorough test matrix. The listing and the in-transaction re-check share one read (
|
…er an immediate txn #946 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Review of #1023 (retention reads the crawl lease). I read the diff and did not run the tests. CI was still pending when I checked. The design looks sound. Every doubtful case resolves to "live", the verdict is a pure function with an injectable environment, and the listing and the re-check inside the retire transaction share one read (
|
…nt, skip reasons, link phrases (#1034) Batch of six reviewed PRs landed through one branch and one CI run: - #1032 Bun 1.4.4 pin (CA blocklist for the eight compromised eMudhra intermediates, NSS 3.131.1 roots) - #1030 nested CSS evidence for the style reader (repro from #1014 by @dbdefault) - #1025 page-intrinsic skips use a not-applicable reason so priors resolve - #1019 generic link phrases in ten more languages for link-text and anchor-text - #1021 content/word-count skips noindex pages - #1023 retirement of abandoned crawls uses the crawl lease Plus a test fix for the residency probe on Bun 1.4.4 linux-x64. Closes #840 Closes #946 Closes #1011 Closes #1013 Refs #841 Signed-off-by: Nik Cubrilovic <[email protected]>
Closes #946. PR 2 of 2: retirement and
self disk --prunenow READ the crawl lease that v0.0.127 (#1017) writes. This is code that deletes crawls, so it needs a data-safety review.What changes
isCrawlAbandoned(newpackages/crawler/src/storage/crawl-liveness.ts, pure apart from an injected clock, host name and pid probe) is the single verdict behindlistAbandonedCrawls,listPossiblyLiveCrawlsand the re-check INSIDE theretireCrawlsDetailedtransaction (one shared read,unfinishedCrawlRows, so they cannot disagree). The pid probe is a synchronous syscall, legal in that transaction.runningcrawl (what--resumecontinues) is abandoned after 24 h of silence, acrawledone after the stale window.stopped,pausedandfailedget the fix(storage): retire crawls from killed audits; prune continues past a failing project #941 #945 verdict only: a dead or unreleased lease never retires a resumable crawl sooner. fix(storage): retire crawls from killed audits; prune continues past a failing project #941 #945 still applies on top, so a dead lease is never kept longer than before.Also:
beat()takes over a same-host lease whose pid is gone at once (so--resumeafter a kill reclaims the lease immediately, not after 5 min);--prune --dry-runshows a held crawl's owner pid, host and heartbeat age; docs (self disk,keep_audits) and CHANGELOG updated.Every way this could delete a live crawl
isReadablePidrunningcrawl retired too early, breaking--resumerunningstopped/paused/failedcrawl with an unreleased lease (kill -9 right after the status write) retired after 5 min instead of 7 daysVerification
packages/crawler/tests/crawl-liveness.test.ts(36 tests): the verdict matrix plus storage cases above. Existingabandoned-crawls,retired-at-migration,retention,disk-prune,stop-interrupted-crawltests pass unchanged. tsgo clean (crawler, apps/cli),make validatepasses./, started first; its rows backdated 3 h so fix(storage): retire crawls from killed audits; prune continues past a failing project #941 #945 alone retires it; audit B (same project, other site) ran to completion with retention. A stayedrunning, not retired, owner kept;self disk --prune --dry-runlisted it as skipped. Afterkill -9of A and a 10 min old heartbeat,--dry-runlists it as abandoned (here fix(storage): retire crawls from killed audits; prune continues past a failing project #941 #945 also applies, since a newer audit finished).crawlkilled withkill -9at 16 pages,audit --resumetook the lease over within 3 s, finished all 80 pages, lease released.crawlthenanalyzeon the newest crawl works.Notes
--resumeof a crawl held by a live owner only yields its heartbeat and still crawls (not a delete path): filed as A second --resume of a crawl held by a live owner keeps crawling it #1026.analyzed, which the abandoned predicate and retention treat as finished, so the lease does not make it trivial. Left for lane R.squirrelscan/skills): no change needed.