Skip to content

keep_audits retention never runs for crawl + analyze + report, only for audit #955

Closed

Description

@deniskern

Summary

[storage] keep_audits retention only runs after squirrel audit. A project audited through the split commands (squirrel crawl, then squirrel analyze, then squirrel report) never retires anything, neither finished audits beyond the window nor the abandoned crawls that v0.0.119 now retires (#941). We use the split pipeline for large sites (over 1,500 pages) so a supervisor can watch each phase; those are exactly the projects whose project.db grows to several GB.

Repro (v0.0.119, macOS)

# squirrel.toml
[project]
name = "oh-split-retire"
url = "https://shopware.dev.one-dot.io"
[storage]
keep_audits = 1
[crawler]
max_pages = 5
for i in 1 2 3; do
  squirrel crawl https://shopware.dev.one-dot.io -m 5
  squirrel analyze
  squirrel report -f json -o r$i.json
done
sqlite3 ~/.squirrel/projects/oh-split-retire/project.db \
  "select substr(id,1,8), status, retired_at is not null from crawls order by started_at"
6e8e2be0|analyzed|0
24d7b9ed|analyzed|0
73e51b18|analyzed|0

One squirrel audit https://shopware.dev.one-dot.io -m 5 -f json -o a.json --no-publish afterwards retires all three at once:

6e8e2be0|analyzed|1
24d7b9ed|analyzed|1
73e51b18|analyzed|1
d04dedf6|analyzed|0

Expected

squirrel analyze (the step that finishes an audit) applies the same keep_audits retention as squirrel audit, including the abandoned-crawl pass from v0.0.119, so the split pipeline and the one-shot audit keep the same storage bound.

Workaround today

squirrel self disk --prune --keep N --project <p> --yes after each split run, which also rebuilds the file every time, the cost the storage docs warn against.

Acceptance Criteria

  • squirrel analyze applies [storage] keep_audits retention (windowed audits and abandoned crawls) after a successful analysis, as squirrel audit does
  • The repro (3x crawl, analyze, report with keep_audits = 1) leaves only the newest audit openable
  • A blocked or failed crawl, keep_audits = 0, and a crawl in another project than the directory config names retire nothing
  • Docs for [storage] keep_audits and squirrel analyze describe it; a test covers the split pipeline

Activity

  1. deniskern commented on Oct 20, 2026

    @deniskern
    Author

    Related observation from running the prune as the workaround on our production runner (v0.0.119, linux-arm64/x64, container memory limit 2 GB):

    squirrel self disk --prune --keep 3 --yes across all 64 projects (21 GB in ~/.squirrel/projects, largest project.db 2.3 GB) was OOM-killed partway through (exit 137, kernel: Memory cgroup out of memory: Killed process (squirrel) total-vm:8512900kB, anon-rss:1277944kB). Running the same command once per project with --project <name> finished all of them with exit 0 (21 → 14 GB).

    So memory seems to accumulate across projects within one prune run rather than being released after each project. Releasing per-project state (or processing projects in a child step) would let the all-projects form run on small hosts; until then --project in a loop works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions