Repository navigation
Conversation
…atus write, from running or paused #1672 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/stop-interrupted-crawl-1672
branch
from
November 11, 2026 00:44
284ee76 to
ca3343d
Compare
Contributor
Author
|
Landed on main as 8294d4e (later commits there carry the review fixes). Closing this draft as superseded. nik |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1672.
After Ctrl-C the crawler's own
stop()writespausedfirst (while the loop is live). The interrupt handler marked only crawls stillrunning, with raw SQL and a filter of its own, so it matched nothing and the crawl stayedpaused; it also bypassed the transition table.Decision (documented in the handler and
docs/configuration/storage.mdx): Ctrl-C ends the crawl asstopped. The table listsstoppedas legal fromrunning,pausedandstopped, so it covers both the plain case and thepausedstop()left. A crawl that already finished (completed,crawled,analyzed,failed) is not turned intostopped.--resumeacceptsstoppedas before.How
packages/crawler/src/storage/crawl-status-write.ts: the guard predicate and its bound allowed-from list (CRAWL_STATUS_GUARD_SQL,crawlStatusAllowedFrom) and a synchronouswriteCrawlStatusGuarded(db, id, to)for a caller that cannot await (a signal handler).SQLiteStorage.updateCrawlnow builds its check from the same two exports, so the storage write and the handler cannot disagree. Behaviour ofupdateCrawlis unchanged.stop-interrupted-crawl.tscallswriteCrawlStatusGuarded(db, id, "stopped"). Still synchronous, best-effort, never creates a database, owned-crawl-by-id, and the lease release is untouched.Acceptance criteria
stopped):stop-interrupted-crawl.test.ts(a crawlstop()leftpausedbecomesstopped)crawl-status-write-1672.test.ts--resumestill resumes it (decideResumereturns{ resume: true })Checks
stop-interrupted-crawl(11),crawl-status-write-1672(50),status-transitions-1659(40, unchanged and passing). tsgo (crawler, cli), root lint, cli format:check,make validate. Temp HOME throughout. One existing assertion changed: a second signal on an already-stoppedcrawl no longer reports 0 marked, because the table listsstopped -> stopped; the status staysstopped. CHANGELOG bullet and the storage docs paragraph included.Agent skill and docs
--resumeonly as "continue an interrupted crawl", which is exactly what still happens; the stored status changes frompausedtostopped, and both resume.docs/configuration/storage.mdx(the status table and the Ctrl-C paragraph) anddocs/crawl.mdxare updated: present.