You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove ReasonSubstrateUnavailable: return Substrate failures as errors, not as state #695
ReasonSubstrateUnavailable is a condition reason that records, as task or workspace state, that a call to Agent Substrate failed. A Substrate outage is not a state of the task. It should be returned as an error to the caller that hit it and not stored. pkg/apis/v1alpha1/types.go already has a TODO saying so.
Where it is used on main
Provisioning (internal/controller/reconciler.go): ensureSubstrateResources, bindGateway, and Resume set Ready=False/SubstrateUnavailable and then return the error. recordFailure in internal/server/server.go stores that condition with state QUEUED and returns Unavailable. The caller already gets the error; the stored condition only repeats it for a later ax describe.
Workspace prepare (internal/controller/workspace.go): SetupComplete and SnapshotReady are set to False/SubstrateUnavailable, and the error is returned as well.
Reading a task (internal/server/server.go): when the task's actor cannot be read, the task is returned with Ready=Unknown/SubstrateUnavailable instead of an error. This is the only place where the reason replaces an error.
Proposed change
Return the error in the provisioning and workspace paths without setting the condition. Whether the task is QUEUED and the RPC returns Unavailable already follows from substrate.IsTransientError, not from the condition.
Decide what reading a task does when Substrate cannot be reached: fail the RPC, or return the stored task without live actor status. Failing makes ax get and ax describe unusable during a Substrate outage, so this needs a decision before the reason can be deleted.
Delete ReasonSubstrateUnavailable and update the tests in internal/controller and internal/server that assert on it.
Related
The same TODO lists ReasonAtespaceCreationFailed, ReasonActorNotFound, ReasonActorCreationFailed, and ReasonActorResumeFailed. They are out of scope here but have the same problem.
Activity
api: align TaskState with Substrate ActorState
api: align TaskState with Substrate ActorState
api: align TaskState with Substrate ActorState (#731)
server: store a task only once its actor exists (#761)
controller: return transient Substrate errors without a condition (#779)
server, controller: stop reporting failures as Ready conditions
server, controller: stop reporting failures as Ready conditions (goog…