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
Commit 8bacabd
Browse filesBrowse the repository at this point in the historyBrowse files
Decouple actor lock TTL from workflow deadline via heartbeat (#14)
ActorWorkflow.ResumeActor and SuspendActor used to derive their workflow
ctx from the Redis lock TTL via acquireActorLock(ctx, id, 30s, 2s) — the
workflow deadline and the lock TTL were a single 28s knob. That meant
image pulls / restores that legitimately need more than 28s death-looped
forever, while raising the knob also raised how long peers wait to retry
an actor after a crashed ateapi replica.
Split the two concerns:
- Lock TTL stays short (30s constant, internal). Bounds peer failover.
- Workflow deadline is a separate operator-configurable knob via the
new --actor-workflow-deadline pflag (default 5m). Bounds a single
Resume/Suspend.
- A heartbeat goroutine refreshes the lock every lockTTL/3 (~10s) for
the full workflow duration. On RefreshLock=false or any Redis error
(peer stole the lock, Redis blip), the workflow ctx is cancelled with
errLostActorLock as the cause so in-flight steps unwind cleanly and
the mutual-exclusion invariant is preserved.
- The release function stops the heartbeat (waits for goroutine exit)
before best-effort ReleaseLock.
Adds store.Interface.RefreshLock with a Redis CAS Lua script mirroring
the existing ReleaseLock script.
Copy file name to clipboardExpand all lines: cmd/ateapi/main.go
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,8 @@ var (
77
77
sessionIDCAPoolFile=pflag.String("session-id-ca-pool", "", "The file that contains the CA pool for signing session JWTs")
78
78
workerpoolCACerts=pflag.String("workerpool-ca-certs", "", "The file that contains the CA for verifying workerpool client certificates.")
79
79
80
+
actorWorkflowDeadline=pflag.Duration("actor-workflow-deadline", 5*time.Minute, "Maximum wall-clock duration of a single Resume/Suspend workflow; raise it for slow image registries.")
81
+
80
82
showVersion=pflag.Bool("version", false, "Print version and exit.")
81
83
authMode=pflag.String("auth-mode", "mtls", "Auth mode for incoming gRPC: mtls|jwt. 'mtls' (default) relies on transport-level mTLS for client identity. 'jwt' additionally requires a Kubernetes ServiceAccount Bearer token on every RPC. Substrate will drop support for JWT auth mode once the Pod Certificates feature is enabled by default in the minimum supported Kubernetes version.")
82
84
clientJWTCAFile=pflag.String("client-jwt-ca-cert", ateapiauth.DefaultServiceAccountCAFile, "CA cert file used to verify TLS when fetching the OIDC discovery document and JWKS for JWT authentication. Defaults to the in-cluster service account CA.")
0 commit comments