Skip to content

fix(spiders): persist seen fingerprints in checkpoints#70

Merged
Liohtml merged 2 commits into
masterfrom
claude/upstream-scrapling-changes-1sub94-pr2
Jul 11, 2026
Merged

fix(spiders): persist seen fingerprints in checkpoints#70
Liohtml merged 2 commits into
masterfrom
claude/upstream-scrapling-changes-1sub94-pr2

Conversation

@Liohtml

@Liohtml Liohtml commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

Upstream sync (2/4). Checkpoints saved on pause wrote seen_fingerprints: Vec::new(), so a resumed crawl lost the dedup set and re-visited every URL crawled before the pause.

  • Scheduler::snapshot() returns pending URLs plus a copy of the seen fingerprint set; Scheduler::restore_seen() restores it.
  • The engine persists the seen set on pause and restores it before re-enqueuing pending URLs on resume (pending URLs bypass the dedup via dont_filter since their fingerprints are part of the restored set).
  • Mirrors upstream Scrapling d1082bd/95687a5, where the scheduler owns checkpoint state including the seen set. In-flight requests remain covered by the existing drain-before-checkpoint on pause (fix: drain tasks before checkpoint and enforce per-domain limit (#9 #10) #22).

Tests

  • Scheduler: snapshot captures pending + seen (including dequeued URLs), restored seen set rejects already-crawled URLs, restored pending re-enqueues with dont_filter.
  • Engine (end-to-end via dev cache): resume skips a follow link whose fingerprint is in the checkpoint; checkpoint written on pause contains non-empty seen fingerprints.

Full suite green locally: 222 passed (cargo test, cargo clippy --all-targets -- -D warnings, cargo fmt --check).

🤖 Generated with Claude Code

https://claude.ai/code/session_01KDFsMaKk764vogjUW3nqpk


Generated by Claude Code

Checkpoints saved on pause wrote an empty seen_fingerprints list, so a
resumed crawl re-visited every URL crawled before the pause: restored
pending requests would re-discover links whose fingerprints were lost
with the in-memory dedup set.

Scheduler gains snapshot() (pending URLs + seen set copy) and
restore_seen(); the engine now persists the seen set on pause and
restores it before re-enqueuing pending URLs on resume. Mirrors upstream
Scrapling d1082bd/95687a5 where the scheduler owns checkpoint state
including the seen set. In-flight requests remain covered by the
existing drain-before-checkpoint on pause.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KDFsMaKk764vogjUW3nqpk
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Liohtml, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bd12739-72fa-4585-ae0c-ae060cf1431d

📥 Commits

Reviewing files that changed from the base of the PR and between df09f89 and a5ca9cf.

📒 Files selected for processing (5)
  • src/spiders/checkpoint.rs
  • src/spiders/engine.rs
  • src/spiders/scheduler.rs
  • tests/engine_crawl.rs
  • tests/spiders_scheduler.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/upstream-scrapling-changes-1sub94-pr2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- Pass the restored fingerprint Vec by value instead of cloning every
  entry, and correct the restore comment: pending requests originally
  enqueued with dont_filter never entered the seen set, and they must
  be re-crawled regardless.
- Write checkpoints compactly: with the seen set persisted the file
  grows with the crawl, and pretty-printing roughly doubles it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KDFsMaKk764vogjUW3nqpk
@Liohtml Liohtml merged commit baaf32e into master Jul 11, 2026
8 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.

2 participants