noCV
PBATCH-109 · Recover and verify

Prove temporary import resources disappear after cancellation

Practice briefChoreAdvanced

Cancelled imports leave temporary files and open connections. A subsequent run inherits resource pressure and appears slower for an unrelated reason.

Focused work estimate
3h + prerequisites
Priority in the scenario
Medium
Engineering practice
Resource lifecycle · Cancellation

Estimated field mix

  • Site reliability40%
  • Data engineering30%
  • Performance engineering30%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional wholesaler imports supplier rows into a staging catalog. The current prototype reads the entire file into memory and restarts from zero after a failure. Build the prototype and generated CSV fixture locally before measuring improvements.

Setup prerequisites

  • Generate a deterministic 250,000-row synthetic CSV with quoted newlines, invalid records and a stated maximum record size.
  • Create a disposable staging database and an import process constrained to 256 MiB; record runtime and available CPU.

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Define ownership and cleanup for temporary files, file descriptors, workers and database connections.
  • Cancel safely at read, validation and commit stages while preserving the last valid recovery checkpoint.
  • Make repeated cancellation safe and keep the source fixture intact.

Implementation constraints

  • Check resource inventories before and after; avoid asserting cleanup from a completion message alone.

Verification to include

  • Cancel at each controlled stage and verify owned resources return to the declared baseline.
  • Run cancellation twice, then resume or start a fresh import and confirm correct results without restarting the environment.

Deliverables

  • Cleanup implementation, resource inventory and cancellation regressions

Rollout and recovery

Run cleanup rehearsal before accepting performance results; quarantine uncertain staging state for explicit recovery rather than deleting it silently.

Value of the work

For the engineer: Practice streaming, backpressure, allocation analysis and resumable work while retaining exact import semantics.

For the team: Develop a repeatable import performance and recovery exercise that exposes memory, throughput and data-quality tradeoffs.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.