carlos / platform Public

activator: a live generations holder under fast raises no alarm

Controller rulings on Task 10. Under fast, DecideAcquire asks the proofs
about an unexpired generations lock through new Proofs fields,
LiveOwnerTerminated and LiveSameBoxEmpty (nil falls back to the ordinary
ones). The activator wires them without the refusal alarms: a refused
proof leaves the lock held until its expiry with no "ALERT ... takeover
refused" line and no sameBox alarm, exactly as without the flag. Expired
locks keep today's alarms. The lease's termination-proof adapter binds
the live proof with its own observer (ObserveLive), never Observe.

A confirmed live takeover logs its own line. haadopt.go notes that
departure adoption keeps today's table under fast.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 0462df5dbb3dec293fe86efc84b21bb14b24c65a parent eb47a23
8 files changed, +294 −20
  • internal/activator/haadopt.go +1 −0
  • internal/activator/hasamebox.go +14 −0
  • internal/activator/hatakeover.go +30 −3
  • internal/activator/hatakeover_test.go +138 −0
  • internal/activator/hawake.go +12 −5
  • internal/hafresh/acquire.go +25 −4
  • internal/hafresh/acquire_test.go +45 −0
  • internal/lease/termination_proof.go +29 −8
diff --git a/internal/activator/haadopt.go b/internal/activator/haadopt.go
index d3d717299..035b426b1 100644
--- a/internal/activator/haadopt.go
+++ b/internal/activator/haadopt.go
@@ -310,6 +310,7 @@ func (a *Service) AdoptHost(ctx context.Context, rt registry.Route, req Adoption
return Deferred, err
}
ctx = context.WithValue(ctx, adoptionCauseKey{}, req.Ref)
+ // No GenerationsFast: adoption keeps today's table under `fast` (safe, only slower).
proofs := hafresh.Proofs{LocalEligible: func() bool { return b.poolEligible(rt) }, SameBoxEmpty: b.sameBoxEmpty(ctx, rt), OwnerTerminated: b.ownerTerminated(ctx, rt)}
if b.TerminationProofs != nil {
adapter := *b.TerminationProofs
diff --git a/internal/activator/hasamebox.go b/internal/activator/hasamebox.go
index 92a03ba37..c07dd767c 100644
--- a/internal/activator/hasamebox.go
+++ b/internal/activator/hasamebox.go
@@ -76,6 +76,20 @@ func (b *ExecBackend) sameBoxEmpty(ctx context.Context, rt registry.Route) func(
}
}
+// sameBoxEmptyLive is the emptiness proof the `fast` rows ask about an
+// unexpired generations lock of this box (hafresh.Proofs.LiveSameBoxEmpty):
+// the same proof, but a refusal raises no alarm, since the lock is then
+// held until its expiry as without the flag.
+func (b *ExecBackend) sameBoxEmptyLive(rt registry.Route) func() (bool, error) {
+ return func() (bool, error) {
+ if err := b.sameBoxProven(rt); err != nil {
+ return false, err
+ }
+ log.Printf("activator: %s: same-box recovery before the lease expires (storage generations, fast): the startup sweep proved every unit stopped and the host's slice reads empty", rt.Host)
+ return true, nil
+ }
+}
+
func (b *ExecBackend) sameBoxProven(rt registry.Route) error {
if err := b.haContained(rt); err != nil {
return fmt.Errorf("not contained: %w", err)
diff --git a/internal/activator/hatakeover.go b/internal/activator/hatakeover.go
index c406d543e..499bc3fd9 100644
--- a/internal/activator/hatakeover.go
+++ b/internal/activator/hatakeover.go
@@ -20,9 +20,10 @@ import (
// hafresh.Proofs.OwnerTerminated, which is ownerTerminated, only for an
// expired lock of another box's non-empty instance id, so an unexpired
// lock is held without asking (N-HA9). With the switch's `fast` (storage
-// generations slice 4) it also asks for an unexpired generations lock,
-// and takes it on the proof; a refused proof leaves that lock held until
-// its expiry rather than refusing the wake. The answer is EC2's, in this box's
+// generations slice 4) it also asks, through ownerTerminatedLive, about
+// an unexpired generations lock, and takes it on the proof; a refused
+// proof leaves that lock held until its expiry, with no alarm, exactly
+// as without the flag. The answer is EC2's, in this box's
// own account and region (termfence.Confirmer): a stopped, running or
// unknown instance, another account or region, or a describe that failed,
// refuses the wake and nothing is written. The host then stays down until
@@ -42,6 +43,32 @@ func (b *ExecBackend) ownerTerminated(ctx context.Context, rt registry.Route) fu
}
}
+// ownerTerminatedLive is the takeover proof the `fast` rows ask about an
+// unexpired generations lock (hafresh.Proofs.LiveOwnerTerminated): nil
+// when OwnerTerminated is not wired. A live holder is no failure: a
+// refused proof leaves the lock held, as without the flag, and raises no
+// alarm (reportLiveTakeover).
+func (b *ExecBackend) ownerTerminatedLive(ctx context.Context, rt registry.Route) func(iid string) (bool, error) {
+ if b.OwnerTerminated == nil {
+ return nil
+ }
+ return func(iid string) (bool, error) {
+ gone, err := b.OwnerTerminated(ctx, iid)
+ b.reportLiveTakeover(rt, iid, gone, err)
+ return gone, err
+ }
+}
+
+// reportLiveTakeover logs a confirmed takeover of an unexpired
+// generations lock; a refused proof logs nothing (the wake is held).
+func (b *ExecBackend) reportLiveTakeover(rt registry.Route, iid string, gone bool, err error) {
+ if !gone || err != nil {
+ return
+ }
+ b.suspectHolders.clear(rt.Host)
+ log.Printf("activator: %s: the holder %s is terminated (EC2); taking the host over before its lease expires (storage generations, fast)", rt.Host, iid)
+}
+
func (b *ExecBackend) reportTakeover(ctx context.Context, rt registry.Route, iid string, gone bool, err error) {
cause := "visitor"
ref, finalizer := ctx.Value(adoptionCauseKey{}).(string)
diff --git a/internal/activator/hatakeover_test.go b/internal/activator/hatakeover_test.go
index 7a14bfc11..68b847456 100644
--- a/internal/activator/hatakeover_test.go
+++ b/internal/activator/hatakeover_test.go
@@ -3,6 +3,7 @@ package activator
import (
"bytes"
"context"
+ "encoding/json"
"errors"
"net/http"
"net/http/httptest"
@@ -260,3 +261,140 @@ func TestTakeoverLiveOwnerDiagnostic(t *testing.T) {
}
})
}
+
+// genLeaseBody is owner's held generations lock (carlos_generation set) at
+// generation 9, expiring at expires.
+func genLeaseBody(t *testing.T, owner string, expires time.Time) []byte {
+ t.Helper()
+ body, err := json.Marshal(hafresh.Lock{Generation: 9, ExpiresAt: expires.UTC(), Owner: owner, GenName: "g-00000000000000000009"})
+ if err != nil {
+ t.Fatal(err)
+ }
+ return body
+}
+
+// Under the switch's `fast` (storage generations slice 4) a wake asks the
+// proofs about an UNEXPIRED generations lock too. A live holder is no
+// failure: a refused proof leaves the lock held, exactly as without the
+// flag, with no ALERT and no alarm state. An expired lock's refused proof
+// still alarms, as today; a proven one is taken before its expiry.
+func TestFastLiveHolderRaisesNoAlarm(t *testing.T) {
+ ctx := context.Background()
+ live := func() time.Time { return time.Now().Add(10 * time.Minute) }
+ expired := func() time.Time { return time.Now().Add(-time.Minute) }
+ requireHeldQuiet := func(t *testing.T, b *ExecBackend, rt registry.Route, body []byte, logs *strings.Builder, owner string) {
+ t.Helper()
+ _, err := b.Acquire(ctx, rt)
+ var held *errLeaseHeld
+ if !errors.As(err, &held) || held.holder != owner {
+ t.Fatalf("a live generations holder: %v, want held by %s", err, owner)
+ }
+ if strings.Contains(logs.String(), "activator: ALERT") {
+ t.Fatalf("a live holder raised an ALERT:\n%s", logs)
+ }
+ b.takeover.mu.Lock()
+ b.sameBox.mu.Lock()
+ alarms := len(b.takeover.alarmed) + len(b.sameBox.alarmed)
+ b.sameBox.mu.Unlock()
+ b.takeover.mu.Unlock()
+ if alarms != 0 {
+ t.Fatalf("a live holder left %d alarm entries", alarms)
+ }
+ if lockWrites(t, b, rt) != 0 || !bytes.Equal(lockBodyOf(b, rt), body) {
+ t.Fatal("the held wake wrote the lock")
+ }
+ }
+ t.Run("other box, not terminated, live", func(t *testing.T) {
+ t.Setenv("CARLOS_HA_GENERATIONS", "fast")
+ logs := captureLog(t)
+ oracle := &terminatedOracle{}
+ b, rt := haBackend(t, "shop.example.com")
+ b.OwnerTerminated = oracle.terminated
+ body := genLeaseBody(t, heldByB, live())
+ putLockFor(t, b, rt, body)
+ requireHeldQuiet(t, b, rt, body, logs, heldByB)
+ if got := oracle.calls(); strings.Join(got, ",") != "i-b" {
+ t.Fatalf("OwnerTerminated asked about %v, want [i-b]", got)
+ }
+ })
+ t.Run("other box, not terminated, expired", func(t *testing.T) {
+ t.Setenv("CARLOS_HA_GENERATIONS", "fast")
+ logs := captureLog(t)
+ b, rt := haBackend(t, "shop.example.com")
+ b.OwnerTerminated = (&terminatedOracle{}).terminated
+ putLockFor(t, b, rt, genLeaseBody(t, heldByB, expired()))
+ _, err := b.Acquire(ctx, rt)
+ var refused *errLeaseRefused
+ if !errors.As(err, &refused) || !strings.Contains(refused.reason, hafresh.ReasonOtherExpired) {
+ t.Fatalf("an expired, unproven holder: %v", err)
+ }
+ if strings.Count(logs.String(), "activator: ALERT") != 1 {
+ t.Fatalf("an expired holder's refused proof did not ALERT once:\n%s", logs)
+ }
+ })
+ t.Run("other box, terminated, live", func(t *testing.T) {
+ t.Setenv("CARLOS_HA_GENERATIONS", "fast")
+ logs := captureLog(t)
+ b, rt := haBackend(t, "shop.example.com")
+ b.OwnerTerminated = (&terminatedOracle{yes: map[string]bool{"i-b": true}}).terminated
+ putLockFor(t, b, rt, genLeaseBody(t, heldByB, live()))
+ l, err := b.Acquire(ctx, rt)
+ if err != nil {
+ t.Fatalf("a live, terminated generations holder was not taken: %v", err)
+ }
+ releaseHALease(t, l)
+ if !strings.Contains(logs.String(), "the holder i-b is terminated (EC2); taking the host over before its lease expires") || strings.Contains(logs.String(), "activator: ALERT") {
+ t.Fatalf("the live takeover's log:\n%s", logs)
+ }
+ })
+ t.Run("other box, proof cache, running, live", func(t *testing.T) {
+ t.Setenv("CARLOS_HA_GENERATIONS", "fast")
+ logs := captureLog(t)
+ b, rt := haBackend(t, "shop.example.com")
+ me := hafresh.Self{Ref: "a", IID: "i-0123456789abcdef0", Account: "111122223333", Region: "eu-west-1"}
+ lease.SetSelf(me)
+ b.Cfg.Region = me.Region
+ iid := "i-1123456789abcdef0"
+ signer := boxidtest.NewSigner(t)
+ _, raw := signer.Record(t, "b", me.Account, me.Region, iid)
+ binding, err := termfence.VerifyProofIdentity(boxid.Verifier{Account: me.Account, Certs: signer.Certs()}, raw, boxid.Expect{Box: "b", AWSRegion: me.Region, TofuInstanceID: iid}, b.Cfg.Bucket)
+ if err != nil {
+ t.Fatal(err)
+ }
+ api := &takeoverDiagnosticEC2{state: ec2types.InstanceStateNameRunning}
+ confirmer := &termfence.Confirmer{Self: func() boxid.Cloud {
+ return boxid.Cloud{Provider: "aws", Account: me.Account, Region: me.Region, InstanceID: me.IID}
+ }, API: func(context.Context, string) (termfence.EC2, error) { return api, nil }, Logf: func(string, ...any) {}}
+ b.TerminationProofs = &lease.TerminationProofAdapter{Cache: &termfence.ProofCache{}, Confirmer: confirmer, Resolve: func(context.Context, string, string) (termfence.ProofIdentity, error) { return binding, nil }, Lifetime: func(context.Context, string, string, string) (string, error) { return haFixOf(b).lifetime, nil }}
+ owner := hafresh.OwnerFor(hafresh.Self{Ref: "b", IID: iid}, 7, true)
+ body := genLeaseBody(t, owner, live())
+ putLockFor(t, b, rt, body)
+ requireHeldQuiet(t, b, rt, body, logs, owner)
+ if api.calls != 1 {
+ t.Fatalf("EC2 asked %d times, want 1", api.calls)
+ }
+ })
+ t.Run("same box, unproven, live", func(t *testing.T) {
+ t.Setenv("CARLOS_HA_GENERATIONS", "fast")
+ logs := captureLog(t)
+ b, rt := haBackend(t, "shop.example.com") // no startup sweep: no emptiness proof
+ owner := hafresh.OwnerFor(hafresh.Self{Ref: "a", IID: "i-a"}, 7, true)
+ body := genLeaseBody(t, owner, live())
+ putLockFor(t, b, rt, body)
+ requireHeldQuiet(t, b, rt, body, logs, owner)
+ })
+ t.Run("same box, unproven, expired", func(t *testing.T) {
+ t.Setenv("CARLOS_HA_GENERATIONS", "fast")
+ logs := captureLog(t)
+ b, rt := haBackend(t, "shop.example.com")
+ putLockFor(t, b, rt, genLeaseBody(t, hafresh.OwnerFor(hafresh.Self{Ref: "a", IID: "i-a"}, 7, true), expired()))
+ _, err := b.Acquire(ctx, rt)
+ var refused *errLeaseRefused
+ if !errors.As(err, &refused) || !strings.Contains(refused.reason, hafresh.ReasonSameBoxUnsure) {
+ t.Fatalf("an expired same-box lock without the proof: %v", err)
+ }
+ if !strings.Contains(logs.String(), "activator: ALERT shop.example.com: same-box recovery refused") {
+ t.Fatalf("an expired same-box refusal did not ALERT:\n%s", logs)
+ }
+ })
+}
diff --git a/internal/activator/hawake.go b/internal/activator/hawake.go
index ccfb03906..7f84ec7ec 100644
--- a/internal/activator/hawake.go
+++ b/internal/activator/hawake.go
@@ -438,17 +438,24 @@ func (b *ExecBackend) acquireClassified(ctx context.Context, rt registry.Route)
}
}
+ // The Live proofs are what the `fast` rows ask about an unexpired
+ // generations lock: the same proofs without the refusal alarms, which
+ // stay for expired locks only (a live holder is held, as without fast).
proofs := hafresh.Proofs{
- LocalEligible: func() bool { return b.poolEligible(rt) },
- SameBoxEmpty: b.sameBoxEmpty(ctx, rt),
- OwnerTerminated: b.ownerTerminated(ctx, rt),
- ObserveRefusal: b.observeHARefusal(ctx, rt),
+ LocalEligible: func() bool { return b.poolEligible(rt) },
+ SameBoxEmpty: b.sameBoxEmpty(ctx, rt),
+ OwnerTerminated: b.ownerTerminated(ctx, rt),
+ LiveSameBoxEmpty: b.sameBoxEmptyLive(rt),
+ LiveOwnerTerminated: b.ownerTerminatedLive(ctx, rt),
+ ObserveRefusal: b.observeHARefusal(ctx, rt),
}
if b.TerminationProofs != nil {
adapter := *b.TerminationProofs
adapter.Observe = func(iid string, gone bool, err error) { b.reportTakeover(ctx, rt, iid, gone, err) }
+ adapter.ObserveLive = func(iid string, gone bool, err error) { b.reportLiveTakeover(rt, iid, gone, err) }
if b.OwnerTerminated != nil {
- proofs.OwnerTerminated = func(iid string) (bool, error) { return b.OwnerTerminated(ctx, iid) }
+ plain := func(iid string) (bool, error) { return b.OwnerTerminated(ctx, iid) }
+ proofs.OwnerTerminated, proofs.LiveOwnerTerminated = plain, plain
}
ctx = lease.WithTerminationProof(ctx, &adapter)
}
diff --git a/internal/hafresh/acquire.go b/internal/hafresh/acquire.go
index 2e2846a17..6b33dc956 100644
--- a/internal/hafresh/acquire.go
+++ b/internal/hafresh/acquire.go
@@ -53,6 +53,26 @@ type Proofs struct {
// storage generations spec §5.3, slice 4). It changes the table only
// for a generations lock (View.Generations): see DecideAcquire.
GenerationsFast bool
+ // LiveOwnerTerminated and LiveSameBoxEmpty are the proofs the `fast`
+ // rows ask about an UNEXPIRED generations lock; nil falls back to
+ // OwnerTerminated and SameBoxEmpty. A refused proof there is no
+ // failure (the owner stays held until its expiry, as without the
+ // flag), so a caller wires these without the alarms it raises when
+ // an expired lock's proof is refused.
+ LiveOwnerTerminated func(iid string) (bool, error)
+ LiveSameBoxEmpty func() (bool, error)
+}
+
+// live is p with the live proofs, where set, in place of the ordinary
+// ones: what the `fast` rows ask about an unexpired lock.
+func (p Proofs) live() Proofs {
+ if p.LiveOwnerTerminated != nil {
+ p.OwnerTerminated = p.LiveOwnerTerminated
+ }
+ if p.LiveSameBoxEmpty != nil {
+ p.SameBoxEmpty = p.LiveSameBoxEmpty
+ }
+ return p
}
// Refusal reasons, matched by callers and tests.
@@ -110,8 +130,9 @@ const (
// - an unexpired owner of this box's non-empty instance id is taken
// with the same-box emptiness proof (the proof stays).
//
-// A missing, false or failed proof leaves an unexpired owner held until
-// its expiry, as without the flag. Every other row, and every row of a
+// These two rows ask p's live proofs (LiveOwnerTerminated,
+// LiveSameBoxEmpty) where set. A missing, false or failed proof leaves an
+// unexpired owner held until its expiry, as without the flag. Every other row, and every row of a
// lock that is not a generations lock, is the table above, whatever the
// flag says.
func DecideAcquire(v View, self Self, now time.Time, term time.Duration, p Proofs) Decision {
@@ -143,9 +164,9 @@ func DecideAcquire(v View, self Self, now time.Time, term time.Duration, p Proof
if fast && o.IID != "" {
var d Decision
if o.IID != self.IID {
- d = decideOtherBox(o, p)
+ d = decideOtherBox(o, p.live())
} else {
- d = decideSameBox(p)
+ d = decideSameBox(p.live())
}
if d.Action == ActTake {
return d
diff --git a/internal/hafresh/acquire_test.go b/internal/hafresh/acquire_test.go
index a8fea047e..01ac1625d 100644
--- a/internal/hafresh/acquire_test.go
+++ b/internal/hafresh/acquire_test.go
@@ -507,3 +507,48 @@ func TestDecideAcquireFastProofScope(t *testing.T) {
}
}
}
+
+// The `fast` rows ask the live proofs about an unexpired generations
+// lock, so a caller can wire them without the alarms it raises when an
+// expired lock's proof is refused; an expired lock is asked through the
+// ordinary ones. Unset live proofs fall back to the ordinary ones
+// (TestDecideAcquireFastProofScope).
+func TestDecideAcquireFastAsksTheLiveProofs(t *testing.T) {
+ now := time.Unix(1_800_000_000, 0)
+ const gen = "g-00000000000000000009"
+ self := Self{Ref: "a", IID: "i-a"}
+ b, mine := OwnerFor(Self{Ref: "b", IID: "i-b"}, 9, true), OwnerFor(self, 9, true)
+ for _, c := range []struct {
+ name string
+ lock Lock
+ want []string
+ action Action
+ answerYes bool
+ }{
+ {"unexpired other, proven", Lock{ExpiresAt: now.Add(time.Minute), Owner: b, GenName: gen}, []string{"live-term:i-b"}, ActTake, true},
+ {"unexpired other, not proven", Lock{ExpiresAt: now.Add(time.Minute), Owner: b, GenName: gen}, []string{"live-term:i-b"}, ActHeld, false},
+ {"unexpired mine, proven", Lock{ExpiresAt: now.Add(time.Minute), Owner: mine, GenName: gen}, []string{"live-same"}, ActTake, true},
+ {"unexpired mine, not proven", Lock{ExpiresAt: now.Add(time.Minute), Owner: mine, GenName: gen}, []string{"live-same"}, ActHeld, false},
+ {"expired other, not proven", Lock{ExpiresAt: now.Add(-time.Minute), Owner: b, GenName: gen}, []string{"term:i-b"}, ActRefuse, false},
+ {"expired mine, not proven", Lock{ExpiresAt: now.Add(-time.Minute), Owner: mine, GenName: gen}, []string{"same"}, ActRefuse, false},
+ } {
+ var asked []string
+ ask := func(what string) (bool, error) {
+ asked = append(asked, what)
+ if c.answerYes {
+ return true, nil
+ }
+ return false, errors.New("unproven")
+ }
+ p := Proofs{LocalEligible: func() bool { return true }, GenerationsFast: true,
+ OwnerTerminated: func(iid string) (bool, error) { return ask("term:" + iid) },
+ SameBoxEmpty: func() (bool, error) { return ask("same") },
+ LiveOwnerTerminated: func(iid string) (bool, error) { return ask("live-term:" + iid) },
+ LiveSameBoxEmpty: func() (bool, error) { return ask("live-same") },
+ }
+ d := DecideAcquire(View{Lock: c.lock}, self, now, 15*time.Minute, p)
+ if d.Action != c.action || strings.Join(asked, ",") != strings.Join(c.want, ",") {
+ t.Errorf("%s: %+v asking %v; want %v asking %v", c.name, d, asked, c.action, c.want)
+ }
+ }
+}
diff --git a/internal/lease/termination_proof.go b/internal/lease/termination_proof.go
index 5185049ca..199bd597a 100644
--- a/internal/lease/termination_proof.go
+++ b/internal/lease/termination_proof.go
@@ -19,6 +19,11 @@ type TerminationProofAdapter struct {
Resolve func(context.Context, string, string) (termfence.ProofIdentity, error)
Lifetime func(context.Context, string, string, string) (string, error)
Observe func(string, bool, error)
+ // ObserveLive receives the answers of the proof DecideAcquire asks about
+ // an unexpired generations lock under the switch's `fast`
+ // (hafresh.Proofs.LiveOwnerTerminated); nil observes none. Observe is
+ // never called for them: a live holder is no refused takeover.
+ ObserveLive func(string, bool, error)
}
type terminationProofKey struct{}
@@ -33,14 +38,31 @@ func bindTerminationProof(ctx context.Context, client *s3.Client, bucket, prefix
if !enabled {
return p
}
- // The closure belongs to this classification round. DecideAcquire invokes it
- // only for a foreign owner: an expired one, or, under the switch's `fast`,
- // an unexpired generations lock's. A CAS retry gets a fresh closure.
- fallback := p.OwnerTerminated
- p.OwnerTerminated = func(iid string) (gone bool, result error) {
+ // The closures belong to this classification round. DecideAcquire invokes
+ // OwnerTerminated only for an expired foreign owner, and, under the
+ // switch's `fast`, LiveOwnerTerminated for an unexpired generations
+ // lock's. Each reports to its own observer. A CAS retry gets fresh ones.
+ liveFallback := p.LiveOwnerTerminated
+ if liveFallback == nil {
+ liveFallback = p.OwnerTerminated
+ }
+ var observe, observeLive func(string, bool, error)
+ if adapter != nil {
+ observe, observeLive = adapter.Observe, adapter.ObserveLive
+ }
+ p.OwnerTerminated = boundTerminationProof(ctx, client, bucket, prefix, region, base, self, v, adapter, p.OwnerTerminated, observe)
+ p.LiveOwnerTerminated = boundTerminationProof(ctx, client, bucket, prefix, region, base, self, v, adapter, liveFallback, observeLive)
+ return p
+}
+
+// boundTerminationProof is the adapter's proof for view v, reporting each
+// answer to observe (nil: none) and falling back to fallback for an
+// unbound box record.
+func boundTerminationProof(ctx context.Context, client *s3.Client, bucket, prefix, region string, base hafresh.Marker, self hafresh.Self, v hafresh.View, adapter *TerminationProofAdapter, fallback func(string) (bool, error), observe func(string, bool, error)) func(string) (bool, error) {
+ return func(iid string) (gone bool, result error) {
defer func() {
- if adapter != nil && adapter.Observe != nil {
- adapter.Observe(iid, gone, result)
+ if observe != nil {
+ observe(iid, gone, result)
}
}()
owner, ok := hafresh.ParseOwner(v.Lock.Owner)
@@ -98,7 +120,6 @@ func bindTerminationProof(ctx context.Context, client *s3.Client, bucket, prefix
}
return notify()
}
- return p
}
func TerminationAcquireBindingValid(v hafresh.View, self hafresh.Self, e boxid.Evidence, bucket, proofBucket, region, lifetime, currentLifetime string) bool {