DEV Community

Sam Yang
Sam Yang

Posted on

Agent Rollback FAQ: Pod Template, Not Side Effects

An illustrative scenario, not a reported incident: a team runs an agent on Kubernetes and files tickets with a shared token. After a prompt change, someone rolls back the Deployment and assumes the tickets disappeared too.

Myth one: rollback undoes the agent's side effects. The Kubernetes Deployment documentation says a revision is created when the Pod template changes; scaling alone creates none. Rolling back to an earlier available revision restores the Pod template. It does not reverse unrelated database changes. Rollback restores configuration, not compensation; external records can remain.

Myth two: a timeout proves the action never happened. The Python asyncio documentation says asyncio.wait_for requests cancellation on timeout and waits for cancellation to complete, so elapsed time can exceed the timeout. If it completes first, wait_for can return normally. Cancellation is local; the remote service may already have accepted it. RFC 9110 adds that a non-idempotent request should be retried automatically only when replay is permitted or the original was never applied.

Test: observe rollback and timeout boundaries

Proposed check, not a reported result. Inputs: a sandbox Deployment, an earlier revision, and a way to inspect an external side-effect record. Record the revision. Change one Pod template field. Observation: a new revision should appear. Create or identify an agent side-effect record and record its ID. Roll back to the recorded revision. Observation: the Pod template should match that revision and the record should still exist. Interpretation: matching template plus surviving record shows rollback restored workload spec, not the side effect. If the record vanished, inspect a separate cleanup process; if no new revision appeared, verify whether the template changed.

For timeout behavior, use a local awaitable that runs longer than the timeout and delays cancellation cleanup; record monotonic time. Observation: a timeout should occur, and elapsed time may exceed the timeout while cancellation completes. If it finishes first, a normal return is expected; that says nothing about remote cancellation. Separately inspect the remote record. If the server shows acceptance despite a local timeout, compensate through the data owner.

This article was created with AI assistance.

Top comments (0)