Skip to content

fix: don't restore crawlEndTime when resuming from checkpoint. - #669

Merged
ato merged 1 commit into
masterfrom
adam/fix_crawl_end_time_checkpoint_resumption
Sep 29, 2025
Merged

ato merged 1 commit into
masterfrom
adam/fix_crawl_end_time_checkpoint_resumption

Conversation

@adam-miller

Copy link
Copy Markdown
Contributor

crawlEndTime remains set to -1 while a crawl is running, and statisticsTracker.getCrawlElapsedTime() relies on this to calculate how long the crawl has run. crawlEndTime is only set to a timestamp when the crawl has terminated, but it is possible to trigger a checkpoint after termination and before teardown. Doing so results in a checkpoint that has a positive value for crawlEndTime. Resuming from this checkpoint results in a state where the crawl is running, but crawlEndTime is set, which can make the elapsed time calculation return a negative value which then breaks the CrawlLimitEnforcer max time limit.

@adam-miller
adam-miller requested a review from ato September 26, 2025 23:03

@ato ato left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems sound to me.

@ato
ato merged commit 978345c into master Sep 29, 2025
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.

3 participants