An interrupted --skip-errors backup keeps opening every remaining file and logs each one as failed #286

Open
opened 2026-10-08 11:12:28 +02:00 by clawbot · 1 comment
Collaborator

processPhase (internal/snapshot/scanner.go:1314-1345) loops over every file to process and never checks whether the run was cancelled. After Ctrl-C or SIGTERM, each processFileStreaming call returns the context's cancellation error. Under --skip-errors, processFileWithErrorHandling (:1353-1389) treats that error like an unreadable file: it prints Failed to process ... context canceled. Skipping (--skip-errors)., counts the file as failed and moves on to the next one. An interrupted backup of a large tree therefore opens and partly reads every remaining file and prints one error line for each, before it finally exits with the interrupted status from #267.

Reported by the worker on #284 and confirmed in the code on next at 79a73fa. Traced, not run.

Definition of done

  1. The processing loop stops at the first file after the run is cancelled, whether or not --skip-errors is set. A cancellation error is never skipped or counted as a failed file.
  2. A test cancels a --skip-errors backup partway through processing and asserts that the run returns the cancellation error and that no file is reported as failed because of it.
  3. make check passes.

Model: opus-5-5

`processPhase` (`internal/snapshot/scanner.go:1314-1345`) loops over every file to process and never checks whether the run was cancelled. After Ctrl-C or SIGTERM, each `processFileStreaming` call returns the context's cancellation error. Under `--skip-errors`, `processFileWithErrorHandling` (`:1353-1389`) treats that error like an unreadable file: it prints `Failed to process ... context canceled. Skipping (--skip-errors).`, counts the file as failed and moves on to the next one. An interrupted backup of a large tree therefore opens and partly reads every remaining file and prints one error line for each, before it finally exits with the interrupted status from https://git.eeqj.de/sneak/vaultik/issues/267. Reported by the worker on https://git.eeqj.de/sneak/vaultik/issues/284 and confirmed in the code on `next` at `79a73fa`. Traced, not run. ## Definition of done 1. The processing loop stops at the first file after the run is cancelled, whether or not `--skip-errors` is set. A cancellation error is never skipped or counted as a failed file. 2. A test cancels a `--skip-errors` backup partway through processing and asserts that the run returns the cancellation error and that no file is reported as failed because of it. 3. `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-08 11:12:28 +02:00
Author
Collaborator

Confirmed on next at 05bf73c with a failing test, then fixed in #287. The processing loop now checks for cancellation before each file, and a file error after the cancel stops the run instead of being skipped. One thing the issue did not say: the cancelled scan also returned no error once it had skipped every remaining file.

Model: opus-5-5

Confirmed on `next` at `05bf73c` with a failing test, then fixed in https://git.eeqj.de/sneak/vaultik/pulls/287. The processing loop now checks for cancellation before each file, and a file error after the cancel stops the run instead of being skipped. One thing the issue did not say: the cancelled scan also returned no error once it had skipped every remaining file. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#286