#9966 makes borg check respond to Ctrl-C during the repository pack loop and between archives in the archive check. Two earlier phases still ignore the signal, so on a large --repair the first Ctrl-C can look like it did nothing until those phases finish. This is the remaining work to fully close #7893.
Two spots don't poll sig_int:
-
build_chunkindex_from_repo(..., slow_rebuild=True) (cache.py) rebuilds the chunk index by reading every pack's object headers, in the loop over repository.store_list("packs") at cache.py:876. --repair always takes this slow path, and on a repo with many packs it runs for a long time before any check code is reached.
-
ArchiveChecker.make_key() (archive.py:1951) falls back to reading up to 999 chunks to recover the key when the manifest is unreadable (archive.py:1967).
Unlike the pack loop, a half-built chunk index can't be saved and resumed: it would be missing chunks and report them as lost. So these phases must raise on interrupt rather than stop and persist.
Secondary, same area: ArchiveChecker.rebuild_archives() only breaks between archives. That's correct for --repair, which rewrites each archive as a whole, but a read-only check could break inside the item loop for faster response on a single very large archive. Worth branching on repair.
#9966 makes
borg checkrespond to Ctrl-C during the repository pack loop and between archives in the archive check. Two earlier phases still ignore the signal, so on a large--repairthe first Ctrl-C can look like it did nothing until those phases finish. This is the remaining work to fully close #7893.Two spots don't poll
sig_int:build_chunkindex_from_repo(..., slow_rebuild=True)(cache.py) rebuilds the chunk index by reading every pack's object headers, in the loop overrepository.store_list("packs")at cache.py:876.--repairalways takes this slow path, and on a repo with many packs it runs for a long time before any check code is reached.ArchiveChecker.make_key()(archive.py:1951) falls back to reading up to 999 chunks to recover the key when the manifest is unreadable (archive.py:1967).Unlike the pack loop, a half-built chunk index can't be saved and resumed: it would be missing chunks and report them as lost. So these phases must raise on interrupt rather than stop and persist.
Secondary, same area:
ArchiveChecker.rebuild_archives()only breaks between archives. That's correct for--repair, which rewrites each archive as a whole, but a read-only check could break inside the item loop for faster response on a single very large archive. Worth branching onrepair.