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
server,controller: bound task reconciliation deadline under the task lock TTL #473
In internal/substrate/client.go, retryOnCodes retries codes.Unavailable and codes.Aborted for up to defaultRetryAttempts = 10 (defaultRetryInterval = 200ms, maxRetryInterval = 2s with jitter), meaning a single Substrate RPC can take up to ~6s–20s before exhausting retries.
Meanwhile, in internal/lock/lock.go, NewRedisLocker acquires the per-task lock with a fixed 30s TTL (ttl = 30 * time.Second) and no renewal. Because Reconcile performs multiple sequential Substrate RPCs (EnsureAtespace, EnsureActorTemplateWithImage, EnsureActor, SuspendActor/ResumeActor, plus defaultWorkspaceReadyTimeout = 15s), if Substrate flaps mid-request across more than one step, a single reconciliation can outlast the 30s task lock TTL while still mutating Substrate and task status in the store.
Proposed Solution
Enforce a per-request / reconciliation context deadline bounded under the task lock TTL (e.g. deriving a context.WithTimeout after acquiring the task lock in CreateTask, ResumeTask, SuspendTask, and DeleteTask, or bounding the reconcile budget relative to the lock TTL) so that an in-flight reconcile cannot continue operating on a task after its lock has expired.
We are closing this as part of a cleanup after the significant changes in v0.4.0, because it is probably obsolete or out of scope now. If you think this is a mistake, please reopen it (or leave a comment if you can't reopen it).
Activity
server,controller: bound task reconciliation deadline under the task …
rakyll commentedon Nov 25, 2026
Obsolete: the Redis lock and its TTL are gone.
We are closing this as part of a cleanup after the significant changes in v0.4.0, because it is probably obsolete or out of scope now. If you think this is a mistake, please reopen it (or leave a comment if you can't reopen it).