Stop a stalled snapshot database read when restore or deep verify is interrupted (closes #356)
check / check (push) Canceled after 0s

Restore and deep verify read the snapshot database straight from
storage rather than through FetchBlob, so the earlier fix for stalled
blob reads did not cover it. A database read stalled on a slow USB
stick or network share kept the operation from returning after Ctrl-C;
the process then exited at the shutdown timeout and left the decrypted
database in the temp directory.

Both reads now wrap the storage reader in the close-on-cancel reader
FetchBlob uses, so a cancel ends the stalled read and the temp
directory is removed. The interrupt test now stalls either a blob or
the snapshot database, for both commands.

Limitation: a read stuck in the kernel that closing cannot interrupt,
such as one on an unresponsive hard NFS mount, still cannot be stopped.

Model: opus-5-5
This commit was merged in pull request #363.
This commit is contained in:
2026-10-13 19:36:43 +02:00
parent 740f474c59
commit dfa3bbc9e1
3 changed files with 82 additions and 56 deletions
+2
View File
@@ -702,6 +702,8 @@ func (v *Vaultik) downloadSnapshotDB(
return nil, "", fmt.Errorf("downloading %s: %w", dbKey, err)
}
reader = newCloseOnCancelReader(v.ctx, reader)
defer func() { _ = reader.Close() }()
// Decrypt and decompress straight from the storage stream, then stream