Skip to content

fix(api): mark sitemap job done even if getCrawl throws - #4266

Open
edenbuilds wants to merge 1 commit into
firecrawl:mainfrom
edenbuilds:fix/sitemap-getcrawl-try-finally-4245
Open

edenbuilds wants to merge 1 commit into
firecrawl:mainfrom
edenbuilds:fix/sitemap-getcrawl-try-finally-4245

Conversation

@edenbuilds

@edenbuilds edenbuilds commented Aug 7, 2026 •

Copy link
Copy Markdown

Summary

  • Move getCrawl() inside the try/finally in processKickoffSitemapJob so Redis/deserialization failures still record sitemap_jobs_done.
  • Prevents crawls from hanging forever when sitemap_jobs and sitemap_jobs_done permanently disagree.

Fixes #4245

Test plan

  • Confirm getCrawl is inside the same try that owns the sitemap_jobs_done finally
  • Simulate getCrawl throw and verify the job id is still sadd'd to sitemap_jobs_done

Made with Cursor


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Move getCrawl() inside the try/finally in processKickoffSitemapJob so sitemap kickoff jobs are still marked done if Redis/deserialization fails, preventing stuck crawls. Fixes #4245.

  • Bug Fixes
    • Call getCrawl(job.data.crawl_id) inside the same try that has the sitemap_jobs_done finally.
    • On errors, the job is still added to sitemap_jobs_done, keeping counters in sync and avoiding hangs.

Written for commit c0cbeaf. Summary will update on new commits.

Review in cubic

Move getCrawl inside the try/finally in processKickoffSitemapJob so a Redis
error cannot leave sitemap_jobs_done permanently short and hang the crawl.

Fixes firecrawl#4245
@edenbuilds
edenbuilds requested a review from mogery as a code owner August 7, 2026 19:45

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

This branch has not been deployed

No deployments
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.

api: getCrawl() outside try/finally in processKickoffSitemapJob — Redis error causes crawl to hang in scraping state forever

2 participants