Skip to content

fix(ri-exchange): an unknown accept outcome is marked failed and retryable #1050

Open

Description

@cristim

Problem

An RI exchange whose accept response was lost (common.ErrOutcomeUnknown, raised by go's single-shot accept from go#299) may already have executed on AWS, but the platform treats it as a plain failure:

  • Approve flow: internal/api/handler_ri_exchange.go (~:2666) calls exchange.ExecuteExchange; at ~:2682 an ErrOutcomeUnknown-wrapped error goes to failExchange, which marks the row failed, releases the cap and leaves it retryable.
  • Interactive flow (~:1921): mapAWSExchangeError maps it to a generic 500 (claimExchangeSubmit partly mitigates a resubmit).
  • Scheduled flow: the exchange email (~:124-215) lists it under failures.
  • ReserveRIExchange (internal/config/store_postgres.go ~:2996-3018) has no guard against reserving the same source RI again while an earlier attempt's outcome is unknown.

Whether AWS rejects a second accept for an already-exchanged source RI is not verified, so a repeat attempt may or may not be safe.

Expected

  • Approve and interactive flows: detect errors.Is(err, common.ErrOutcomeUnknown), mark the row "outcome unknown, reconcile" (not failed, not retryable), and tell the operator to check the source RI and target reservation in the account.
  • Scheduled flow: read ExchangeOutcome.OutcomeUnknown (being added in cloud-commitments-go#443, which keeps such outcomes in Failed) and render them separately.
  • Block reserving a source RI that has an unresolved outcome-unknown attempt.

Found while planning cloud-commitments-go#443.

Activity

  1. cristim commented on Oct 17, 2026

    @cristim
    MemberAuthor

    Claiming: working on this [claude-cc-impl]

  2. self-assigned this
    on Oct 17, 2026
  3. cristim commented on Oct 17, 2026

    @cristim
    MemberAuthor

    Released: deprioritized for the owner's P1 queue (2026-10-17). Findings so far: the upstream support is done (cloud-commitments-go#443 via go PRs #497/#499), so the platform needs a go dependency bump first, then the approve/interactive handling and the ReserveRIExchange guard. No code was written. [claude-cc-impl]

  4. removed their assignment
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions