Skip to content

Keep domain reservations until application-deletion cleanup is confirmed #474

Done

Description

@samuelmbabhazi

Problem and impact

Deleting an application can bypass the domain-retention protection added for #302. In a failed deployment, cleanup actions may still be queued, in flight or uncertain while allocations have already been marked stopped. The deletion path can then remove the application and cascade-delete its domain reservations even though a node may still serve an old route or container.

Another application in the same organization can claim the released hostname while the actual route still names the previous application. This is a routing/ownership consistency issue inside one organization; no cross-organization takeover was demonstrated.

Priority: P2, from the 2026-11-25 security audit. Affected snapshot: main 1295e534d7a1c3cd0a492449de8806aa532a4924. This is a follow-up for the application-deletion path, not a claim that the configuration-edit fix in closed #302 is absent.

Evidence and scenario

  1. A first deployment reaches a stage where a route may have been applied, then fails or loses contact with the node.
  2. DeploymentPipeline.recover enqueues recovery before marking the release's allocations stopped when routing is not new_release_serving.
  3. PrismaPipelineStore.stop updates that state before the asynchronous cleanup is acknowledged.
  4. Application deletion checks active deployment and observed allocations, then consumes the required confirmation and deletes the application.
  5. forApplication selects only allocations with state placed. The database's application/domain relationship cascades deletion, bypassing the normal releaseUnservedDomains checks for uncertain actions.

Evidence level: static control-flow and database-constraint review. This scenario has not been reproduced end to end against a disconnected VM and Caddy. The existing successful-cleanup deletion case does not exercise it.

Proposed correction

Reject or defer application deletion while relevant cleanup remains uncertain, or retain a deletion tombstone and domain claims until cleanup is acknowledged. Resolve the database/model-invariant design through the repository's required review before implementation.

Acceptance criteria

  • With route removal or container cleanup pending/failed after a failed deployment, deleting the application does not free a hostname that may still be served.
  • Another application in the same organization cannot claim that hostname until cleanup is confirmed.
  • Confirmed cleanup permits eventual deletion and domain release, including retry/restart recovery.
  • Tests cover the first-deployment failure case, uncertain agent actions and an offline node; add a disposable Caddy integration case when practical.
  • Confirmation and audit events accurately describe the completed state change.

Activity

  1. added
    bug
    priority:P2
    on Nov 25, 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

    bugpriority:P2securitytrack:control-plane

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions