Skip to content

Instance lifecycle ops aren't atomic #299

Description

@saketh-are

delete_instance (crates/services/src/agent/service.rs:2888) calls the external CrabShack Agent API first (:2913-2919, DELETE {manager.url}/instances/{name}) and does its own DB write after (:2937-2939). If the DB write fails, CrabShack has already destroyed the instance while chat-api reports failure — state diverges.

Fix: Make lifecycle ops transactional/idempotent or reconcilable — e.g. write a pending-intent row before the API call and reconcile on failure, or make the sequence safely retryable so the DB and CrabShack can't permanently diverge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions