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
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.
drainDelay=pflag.Duration("drain-delay", 13*time.Second, "How long to keep accepting new work after SIGTERM, before starting the gRPC drain.")
89
88
drainTimeout=pflag.Duration("drain-timeout", 15*time.Second, "Deadline for the graceful gRPC drain on shutdown. In-flight RPCs still running past it are forcefully cancelled.")
90
89
90
+
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.")
91
+
91
92
showVersion=pflag.Bool("version", false, "Print version and exit.")
92
93
logLevelFlag=pflag.String("log-level", "info", "Minimum log level: debug, info, warn, or error.")
93
94
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