A Time-Limited Claim for Background Work

A lease can assign a job to a worker for a bounded period. The protocol must address what happens if the old worker continues past expiry.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace an expired claim
  2. Validate the current claim
  3. Trace a late completion after reassignment
  4. Verify expiry and renewal against the authority

Trace an expired claim

Worker A takes a job but stalls. Worker B claims it after A's lease expires. A later wake-up by A still cannot prove its result should be accepted. See queue claims.

Validate the current claim

A storage boundary can check a token or version attached to the active claim. Leadership fencing explains a related protection for older owners.[1]

Trace a late completion after reassignment

Worker A receives job seven with a lease and a claim token. Its lease expires and B receives a new token. If A returns late, the application can require its token to still match before accepting completion. See claiming shared work.

A claims job 7 with token X
X expires
B claims with token Y
A presents X → stale completion. B can complete with Y under the rule.

Verify expiry and renewal against the authority

Lease timestamps should use the agreed clock or store semantics. Test delayed work and renewal just before expiry. When work affects another system, also consider duplicate external effects.

References

  1. Google, Site Reliability Engineering ↩