Skip to content

fix(purchase): fail a plan step's root row atomically with its reason and suppression release #1052

Open

Description

@cristim

failExistingPlanStep (internal/purchase/notifications.go) fails a plan step's root execution row in two steps: the pinned compare-and-set to failed (TransitionExecutionStatusPinned, which has no transaction variant) commits first, then a separate transaction stamps Error and NoSubmission and deletes the row's suppressions.

If the process dies between the two, the row stays failed without the reason or the no-submission proof, and its suppressions stay until they expire. adoptableRootRow only adopts pending or notified roots, so no later tick repairs it.

It fails closed: suppressions only hide recommendations, and a failed row without NoSubmission is treated as outcome unknown. Nothing is bought.

The missing reason predates #905. The finding-2 fix on #905 adds the suppression release, so a crash can now also leave those suppressions in place on rows that carry recommendations.

Fix direction: add a transaction variant of TransitionExecutionStatusPinned so the CAS, the stamp and the suppression release commit together.

Tracked in known_issues/36_plan_step_fail_cas_not_atomic.md. Refs #631, #905.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions