Repository navigation
fix(storage): retire crawls from killed audits; prune continues past a failing project #941 - #945
Conversation
|
Review of #945 (retire abandoned crawls, per-project prune). I read the diff only and did not run the tests. The storage-layer changes (
|
fcff05a to
9ad48be
Compare
…a failing project #941 Abandoned crawls (unfinished, older than the newest finished audit) are retired by keep_audits and self disk --prune, take no window slot, and are re-checked inside the retiring transaction. Prune isolates each project, checks free disk before VACUUM, prints a summary and exits 1 only on failure. Ctrl-C marks the owned crawl stopped. Signed-off-by: Nik Cubrilovic <[email protected]>
…941 Latest page or frontier timestamp must be older than 30 minutes, so an overlapping live audit is never retired. Recently active orphans are skipped with their last activity. Signed-off-by: Nik Cubrilovic <[email protected]>
9ad48be to
c0aeb47
Compare
|
Reviewed the diff (retention,
Test coverage looks good: the new tests cover the predicate, the retention integration, the signal-path write and the prune plan. One gap is a test for the batch-refusal race in the first finding. |
Review of #945Well-structured overall: the abandoned predicate is shared between the listing and the in-transaction re-check, and test coverage is strong. A few things to consider.
No security concerns: SQL interpolates only a computed integer cutoff and static strings, and ids are bound parameters. |
…s; longer grace for stopped/paused #941 retireCrawlsDetailed skips ids that stopped qualifying inside the transaction and retires the rest. stopped/paused need 7 days idle. failed is unfinished in all three queries. Signal mark opens with create:false. Signed-off-by: Nik Cubrilovic <[email protected]>
|
Reviewed the diff (retention, prune, storage, Ctrl-C handling, tests). The design is careful: the abandoned predicate is shared between the listing and the in-transaction re-check, per-project failures are isolated, and test coverage is good. Findings:
No critical or high-severity problems found. |
What
kill -9, watchdog, OOM) are "abandoned" once a newer audit of the project has finished: unfinished, not retired, started before the newest finished crawl.[storage] keep_auditsandself disk --prunenow retire them. They take no window slot.retireCrawls(ids, at, { allowAbandoned })skips the finished-only guard only for ids that still satisfy the abandoned predicate, re-checked inside the retiring transaction. A newest or live crawl is still refused.self disk --prune: each project is planned and run on its own (a locked or unreadable db is reported, the rest continue); abandoned crawls are listed apart with status and age; unfinished crawls newer than the newest finished audit are listed as skipped with a reason; free disk is checked before VACUUM (retire anyway, skip rebuild, report skipped); final summary; exit 1 only when a project failed.stopped, so--resumecontinues it.Why
Closes #941. Retention only looked at finished audits, so killed crawls and their bulk rows (
sitemap_urls,frontier,rule_results) piled up forever, and prune threw on the first unfinished crawl and aborted every later project.Liveness (updated)
A crawl is only retired when it also has had no activity (latest page or frontier timestamp) for 30 minutes, so an overlapping live audit is never retired and recently active orphans are listed as skipped with their last activity. Remaining gap: a killed newest crawl stays until the next successful audit, and a crawl killed less than 30 minutes ago is retired by a later audit.
stoppedandpausedcrawls (what--resumecontinues; Ctrl-C leaves one) need 7 days idle instead.failedis unfinished in all three queries: abandoned under the same rule, and when newer than the newest finished audit it is skipped, never holding a--keepslot. A crawl that turns active between listing and write is skipped alone and the rest of the batch retires. Known limit: an overlapping audit silent for 30+ minutes in its analyze phase looks abandoned (test documents it); a pid/heartbeat lease closes that: #946.Reproducing the issue's kill -9 loop now needs a 30-minute wait (or crawls whose last page is older than that) before an audit or prune retires the killed crawls.
Tests
Real temp SQLite: predicate matrix, retention retiring orphans without window slots, resumed-crawl refusal in the transaction, prune with killed + live + finished crawls, repeated prune keeps the window, a fresh-activity orphan kept vs a 31-minute-idle one retired, one bad project does not stop the rest, exit codes, low-disk skip, signal path. Docs updated (
tangly check --strictpasses), CHANGELOG entry added.skills: no change (the squirrelscan skill does not document
self disk --prune).