Skip to content

fix(postie): preserve cancellation during parallel PAR2 work - #283

Merged
javi11 merged 1 commit into
mainfrom
fix/issue-184-par2-cancellation
Oct 16, 2026
Merged

javi11 merged 1 commit into
mainfrom
fix/issue-184-par2-cancellation

Conversation

@javi11

@javi11 javi11 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

When the main upload finishes before a parallel PAR2 operation, cancelling the job can still return success: the PAR2 branch tolerates its error, then the caller publishes an NZB and deletes generated recovery files in standalone mode.

Check the job context after joining the parallel branches in single-file and folder posting. A cancelled attempt now returns the context error before NZB publication or success cleanup. Ordinary PAR2 failures retain their existing fallback behavior.

Add four deterministic regressions covering cancellation during PAR2 generation and upload in both paths, plus local NNTP/SQLite integration tests that retry the durable transfer with a fresh Postie instance and real PAR2 generation.

Refs #184. This addresses a distinct cancellation defect; the nonblocking verification architecture and reused-source PAR2 ownership/duplication fixes are already present.

Validation:

  • New deterministic regressions failed on the original implementation in all four cases (successful NZB publication; generated recovery files also deleted in upload-stage cases), then passed with the fix.
  • make: passed after make build-frontend supplied the fresh checkout's missing embed prerequisite; includes generation, tidy, lint, Bun frontend build, and go test -race ./....
  • Backend race sweep across Postie, PAR2, sweeper, poster, verification, transfer writer/cleaner/store, manifests, processor and queue: passed.
  • go test -race ./pkg/postie -run 'Test(Integration_ParallelPar2CancellationCanRetry|ParallelPar2CancellationDoesNotCompleteUpload)' -count=20: passed.
  • git diff --check: passed.

@javi11
javi11 merged commit db68f6c into main Oct 16, 2026
4 checks passed
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.

1 participant