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
Lease expiry is judged by each worker's clock: a worker whose clock runs ahead takes over live leases #45
fetch_orchestration_item decides whether a lease has expired by comparing locked_until with the caller's p_now_ms. If a worker's clock runs ahead of the lease owner's by more than the time left on the lease, that worker takes the instance over while the owner is still working. With the default 5 s orchestration lock, renewed every 3 s, a 2 s lead is enough.
Since #44 this no longer corrupts data. Renewal and acknowledge are fenced on the lock token, so the old owner's calls fail and no message is processed twice. But the turn runs twice, and the takeover repeats every renewal cycle for as long as the clocks disagree.
Activity and session leases have the same problem in both directions, because they are written and checked with the worker's own clock. A worker whose clock runs behind writes leases that every other worker already sees as expired.
This departs from the "Rust-provided timestamps" design of migration 0006.
Tests that simulate the future by passing a later p_now_ms will need another way to expire a lease.
Until then
Keep worker clocks within orchestrator_lock_timeout minus the renewal interval of each other: 2 s at the defaults. A longer lock timeout widens this margin.
Activity