region HA P1a Task 12: same-box recovery after expiry only by the startup sweep's proof and an empty host slice
sameBoxEmpty is the HA acquire's SameBoxEmpty proof for an expired lock this box's instance id holds. True only when the row is contained (nested, not unit-backed, the nested gate passing), this agent's startup sweep proved every instance unit stopped, this process never acquired the host (acquiredHere, marked on every successful Acquire, HA or legacy), the host slice reads absent or unpopulated, and the host's flat cgroup reads absent or unpopulated (no delegation refuses). Every refusal is logged as an ALERT, throttled per host. No S3 request. The SetSameBoxProof hook is removed: the acquire always asks sameBoxEmpty, and StartupSwept nil refuses as the hook's nil did. The Task 11 crash witness now runs on the real proof.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 files changed,
+423
−23
internal/activator/backend_exec.go+15 −7internal/activator/hasamebox.go+169 −0internal/activator/hasamebox_test.go+234 −0internal/activator/hasecrets_test.go+4 −4internal/activator/hawake.go+1 −12
CI failed — run details
diff --git a/internal/activator/backend_exec.go b/internal/activator/backend_exec.go| index f051c3b03..1c9bac847 100644 |
| --- a/internal/activator/backend_exec.go |
| +++ b/internal/activator/backend_exec.go |
| @@ -333,12 +333,13 @@ type ExecBackend struct { |
| // before every wake. Nil: every provisioned instance reads its record. |
| Lifetimes *provision.LifetimeIndex |
| // StartupSwept reports whether this agent's startup sweep proved every |
| - // instance unit stopped (the same-box recovery proof, Task 12). Nil: |
| - // never proven. |
| + // instance unit stopped (the same-box recovery proof, hasamebox.go). |
| + // Nil: never proven, and every same-box takeover of an expired HA lock |
| + // is refused. |
| StartupSwept func() bool |
| - // sameBoxProof is SetSameBoxProof's hook. Nil refuses every same-box |
| - // takeover of an expired HA lock. |
| - sameBoxProof func(ctx context.Context, rt registry.Route) func() (bool, error) |
| + // sameBox is the same-box recovery's state (hasamebox.go): the hosts |
| + // this process has acquired (acquiredHere). |
| + sameBox sameBoxState |
| // haWakes is each host's last Acquire classification (hawake.go). |
| haWakes haWakes |
| // entryFiles is the Service's lookup of an awake entry's files |
| @@ -750,8 +751,15 @@ func (b *ExecBackend) Acquire(ctx context.Context, rt registry.Route) (Lease, er |
| return nil, err |
| } |
| // Then the region HA classification (hawake.go): a legacy route, a |
| - // host that is not HA, or an HA one, each to its own acquire. |
| - return b.acquireClassified(ctx, rt) |
| + // host that is not HA, or an HA one, each to its own acquire. Every |
| + // acquire that succeeds puts the host in acquiredHere for the life of |
| + // this process: its lock is never taken back on the startup sweep's |
| + // proof (hasamebox.go). |
| + l, err := b.acquireClassified(ctx, rt) |
| + if err == nil { |
| + markAcquiredHere(b, rt.Host) |
| + } |
| + return l, err |
| } |
| // AdmitConfig asks the config gate whether this box can provide rt's config: |
diff --git a/internal/activator/hasamebox.go b/internal/activator/hasamebox.go| new file mode 100644 |
| index 000000000..e084b9a6d |
| --- /dev/null |
| +++ b/internal/activator/hasamebox.go |
| @@ -0,0 +1,169 @@ |
| +package activator |
| + |
| +import ( |
| + "context" |
| + "errors" |
| + "fmt" |
| + "log" |
| + "path/filepath" |
| + "sync" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/cgroup" |
| + "github.com/carlosframework/platform/internal/registry" |
| +) |
| + |
| +// Region HA P1a, same-box recovery after expiry (r3.5, invariant I1: no |
| +// second writer on the same box after an agent crash). |
| +// |
| +// When the agent dies with an HA host awake, the host's lock stops |
| +// renewing. No other box ever takes an expired HA lock |
| +// (hafresh.ReasonOtherExpired), so the host comes back only on this box, |
| +// once the lock has expired (up to one lease TTL, lease.LeaseTTL, 15 |
| +// minutes, after the crash), and only on proof that nothing of the host |
| +// still runs here: hafresh.Proofs.SameBoxEmpty, which is sameBoxEmpty. |
| +// |
| +// The proof is root's existing stop-and-prove for nested units; P1a adds |
| +// none. sameBoxEmpty answers true only when all of these hold: |
| +// |
| +// 1. haContained: the row is nested, not unit-backed, on a box whose |
| +// nested gate passes. A flat row, a unit row, or a box that cannot run |
| +// nested (no control channel, NestedOK failing) is refused. |
| +// 2. StartupSwept: this agent's startup /sweep stopped every instance |
| +// unit on the box, of every template (run, seed, sidecar, cmd, |
| +// generation and the rootfs ones), and proved each one gone: inactive |
| +// or failed, its cgroup under the host slice empty, and for a rootfs |
| +// unit also the group systemd reports for it, wherever that is |
| +// (instancectl's rootfsUnitProven). A sweep that failed, did not run |
| +// (claim control) or is not wired proves nothing. |
| +// 3. The host is not in acquiredHere. Every unit of a host starts from |
| +// this activator, for a wake, or for a generation, run, seed or |
| +// sidecar of an awake entry, and so only after an Acquire of the host |
| +// by this process. A host this process never acquired has no unit this |
| +// process started, so the lock is a previous agent process's, and |
| +// every unit that process started was swept (2). A lock this process |
| +// wrote is settled by its own stop and marker, and is refused here |
| +// whatever its pid says (pids repeat across boots). |
| +// 4. hostSliceEmpty: the host slice reads absent or unpopulated. Every |
| +// nested unit of the host runs under it, so one read covers them all. |
| +// 5. The host's flat cgroup (under the agent's delegated subtree) reads |
| +// absent or unpopulated, which needs delegation. |
| +// |
| +// An absent host slice. It counts as empty, because 2 and 3 already place |
| +// every unit of the host, wherever systemd put it: a unit a previous |
| +// process started is proven gone by the sweep, a misplaced rootfs unit's |
| +// reported group included, and this process started none. The one place a |
| +// process of a nested host could live outside both is the flat layout's: |
| +// a process from a flat past of the host, in the agent's own delegated |
| +// subtree, which the sweep never reads. systemd kills the agent service's |
| +// cgroup on a restart, but a process that survived its final SIGKILL |
| +// stays in the cgroup the new agent inherits, so 5 reads it. A box without |
| +// delegation has no subtree to read: nothing tells such a process apart |
| +// from the agent, and the host is refused (cgroup.ErrNoDelegation). |
| +// |
| +// Every refusal is logged (sameBoxAlarm) and fails the wake with |
| +// "same box without emptiness proof: <why>". The proof costs no S3 |
| +// request: every read is the box's own. |
| +func (b *ExecBackend) sameBoxEmpty(ctx context.Context, rt registry.Route) func() (bool, error) { |
| + return func() (bool, error) { |
| + if err := b.sameBoxProven(rt); err != nil { |
| + b.sameBox.alarm(rt.Host, err) |
| + return false, err |
| + } |
| + log.Printf("activator: %s: same-box recovery: 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) |
| + } |
| + if b.StartupSwept == nil || !b.StartupSwept() { |
| + return errors.New("this agent's startup sweep did not prove every instance unit stopped") |
| + } |
| + if b.sameBox.acquiredHere(rt.Host) { |
| + return errors.New("this agent process acquired the host itself; its own stop and marker settle the lock") |
| + } |
| + empty, err := b.hostSliceEmpty(rt) |
| + if err != nil { |
| + return fmt.Errorf("the host's slice: %w", err) |
| + } |
| + if !empty { |
| + return errors.New("the host's slice is populated") |
| + } |
| + exists, populated, err := b.flatHostEvents(rt.Host) |
| + if err != nil { |
| + return fmt.Errorf("the host's flat cgroup: %w", err) |
| + } |
| + if exists && populated { |
| + return errors.New("the host's flat cgroup is populated") |
| + } |
| + return nil |
| +} |
| + |
| +// flatHostEvents reads host's flat cgroup, carlos-exec@<host> under the |
| +// agent's delegated subtree: absent, or present and populated or not. No |
| +// delegation is cgroup.ErrNoDelegation, never absent. |
| +func (b *ExecBackend) flatHostEvents(host string) (exists, populated bool, err error) { |
| + if f := b.sameBox.flatEvents; f != nil { |
| + return f(host) |
| + } |
| + root := b.Cgroups.Root() |
| + if root == "" { |
| + return true, true, cgroup.ErrNoDelegation |
| + } |
| + return readCgroupEvents(filepath.Join(root, cgroup.ExecName(host), "cgroup.events")) |
| +} |
| + |
| +// sameBoxAlarmEvery is how often one host's refused same-box recovery is |
| +// logged again while its wakes keep being refused. |
| +const sameBoxAlarmEvery = time.Minute |
| + |
| +// sameBoxState is ExecBackend's same-box recovery state: the hosts this |
| +// process has acquired, when each host's refusal was last logged, and the |
| +// flat cgroup read's test seam. |
| +type sameBoxState struct { |
| + mu sync.Mutex |
| + acquired map[string]bool |
| + alarmed map[string]time.Time |
| + // flatEvents reads a host's flat cgroup. Nil: under Cgroups' root. |
| + flatEvents func(host string) (exists, populated bool, err error) |
| +} |
| + |
| +func (s *sameBoxState) markAcquired(host string) { |
| + s.mu.Lock() |
| + defer s.mu.Unlock() |
| + if s.acquired == nil { |
| + s.acquired = map[string]bool{} |
| + } |
| + s.acquired[host] = true |
| +} |
| + |
| +func (s *sameBoxState) acquiredHere(host string) bool { |
| + s.mu.Lock() |
| + defer s.mu.Unlock() |
| + return s.acquired[host] |
| +} |
| + |
| +// alarm logs a refused same-box recovery, at most once a minute per host. |
| +// The host stays down until the proof holds: no other box takes its lock. |
| +func (s *sameBoxState) alarm(host string, why error) { |
| + s.mu.Lock() |
| + now := time.Now() |
| + last, seen := s.alarmed[host] |
| + if seen && now.Sub(last) < sameBoxAlarmEvery { |
| + s.mu.Unlock() |
| + return |
| + } |
| + if s.alarmed == nil { |
| + s.alarmed = map[string]time.Time{} |
| + } |
| + s.alarmed[host] = now |
| + s.mu.Unlock() |
| + log.Printf("activator: ALERT %s: same-box recovery refused: %v (the HA lock expired on this box; no other box takes it, so the host stays down until this proof holds)", host, why) |
| +} |
| + |
| +// markAcquiredHere records that this process acquired host (any acquire, |
| +// HA or legacy). Nothing removes it: see sameBoxEmpty, 3. |
| +func markAcquiredHere(b *ExecBackend, host string) { b.sameBox.markAcquired(host) } |
diff --git a/internal/activator/hasamebox_test.go b/internal/activator/hasamebox_test.go| new file mode 100644 |
| index 000000000..e5b4d9607 |
| --- /dev/null |
| +++ b/internal/activator/hasamebox_test.go |
| @@ -0,0 +1,234 @@ |
| +package activator |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "errors" |
| + "strings" |
| + "sync" |
| + "testing" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/hafresh" |
| + "github.com/carlosframework/platform/internal/registry" |
| +) |
| + |
| +// sliceEvents is the host slice as cgroupfs shows it: present, populated |
| +// or not. A unit's own cgroup reads absent. |
| +func sliceEvents(populated bool) CgroupEvents { |
| + return func(_, unit string) (bool, bool, error) { |
| + if unit == "" { |
| + return true, populated, nil |
| + } |
| + return false, false, nil |
| + } |
| +} |
| + |
| +// noFlatCgroup is a delegated box with no flat cgroup for any host. |
| +func noFlatCgroup(string) (bool, bool, error) { return false, false, nil } |
| + |
| +// sameBoxReady is b as a restarted agent whose startup sweep succeeded: |
| +// the sweep proven, the host's slice present and empty, no flat cgroup. |
| +func sameBoxReady(b *ExecBackend) { |
| + b.StartupSwept = func() bool { return true } |
| + b.CgroupEvents = sliceEvents(false) |
| + b.sameBox.flatEvents = noFlatCgroup |
| +} |
| + |
| +func TestSameBoxEmptyNeedsTheNestedProof(t *testing.T) { |
| + ctx := context.Background() |
| + for _, tc := range []struct { |
| + name string |
| + mod func(*ExecBackend, *registry.Route) |
| + want bool |
| + }{ |
| + {"swept, slice empty", nil, true}, |
| + {"sweep failed", func(b *ExecBackend, _ *registry.Route) { b.StartupSwept = func() bool { return false } }, false}, |
| + {"no sweep wired", func(b *ExecBackend, _ *registry.Route) { b.StartupSwept = nil }, false}, |
| + {"acquired by this process", func(b *ExecBackend, rt *registry.Route) { markAcquiredHere(b, rt.Host) }, false}, |
| + {"slice populated", func(b *ExecBackend, _ *registry.Route) { b.CgroupEvents = sliceEvents(true) }, false}, |
| + {"slice unreadable", func(b *ExecBackend, _ *registry.Route) { |
| + b.CgroupEvents = func(string, string) (bool, bool, error) { return true, true, errors.New("permission denied") } |
| + }, false}, |
| + {"flat", func(b *ExecBackend, rt *registry.Route) { flattenRoute(t, b, rt) }, false}, |
| + {"unit-backed", func(_ *ExecBackend, rt *registry.Route) { rt.Backing = registry.BackingUnit }, false}, |
| + {"no control channel", func(b *ExecBackend, _ *registry.Route) { b.Control = nil }, false}, |
| + {"nested gate fails", func(b *ExecBackend, _ *registry.Route) { |
| + b.NestedOK = func() error { return errors.New("instance control not ready") } |
| + }, false}, |
| + // The slice gone is empty only beside a flat cgroup proven absent |
| + // or empty: a process of the host from a flat past would live there. |
| + {"slice absent", func(b *ExecBackend, _ *registry.Route) { |
| + b.CgroupEvents = func(string, string) (bool, bool, error) { return false, false, nil } |
| + }, true}, |
| + {"slice absent, flat cgroup populated", func(b *ExecBackend, _ *registry.Route) { |
| + b.CgroupEvents = func(string, string) (bool, bool, error) { return false, false, nil } |
| + b.sameBox.flatEvents = func(string) (bool, bool, error) { return true, true, nil } |
| + }, false}, |
| + {"flat cgroup present and empty", func(b *ExecBackend, _ *registry.Route) { |
| + b.sameBox.flatEvents = func(string) (bool, bool, error) { return true, false, nil } |
| + }, true}, |
| + {"flat cgroup unreadable", func(b *ExecBackend, _ *registry.Route) { |
| + b.sameBox.flatEvents = func(string) (bool, bool, error) { return true, true, errors.New("permission denied") } |
| + }, false}, |
| + // Undelegated: the agent has no cgroup subtree, so nothing proves |
| + // where a flat process of the host would be. |
| + {"undelegated", func(b *ExecBackend, _ *registry.Route) { b.sameBox.flatEvents, b.Cgroups = nil, nil }, false}, |
| + } { |
| + b, rt := haBackend(t, "shop.example.com") |
| + sameBoxReady(b) |
| + if tc.mod != nil { |
| + tc.mod(b, &rt) |
| + } |
| + before := len(haFixOf(b).fx.Requests()) |
| + ok, err := b.sameBoxEmpty(ctx, rt)() |
| + if n := len(haFixOf(b).fx.Requests()) - before; n != 0 { |
| + t.Errorf("%s: the proof made %d S3 requests", tc.name, n) |
| + } |
| + if ok != tc.want { |
| + t.Errorf("%s: %v (%v)", tc.name, ok, err) |
| + } |
| + if !ok && err == nil { |
| + t.Errorf("%s: refused without saying why", tc.name) |
| + } |
| + } |
| +} |
| + |
| +// Every acquire this process makes puts the host in acquiredHere, an HA |
| +// one and a legacy one alike, and nothing takes it out: a lock this |
| +// process wrote is never taken back on the startup sweep's proof. |
| +func TestAcquireMarksTheHostAcquiredHere(t *testing.T) { |
| + ctx := context.Background() |
| + b, rt := haBackend(t, "shop.example.com") |
| + sameBoxReady(b) |
| + if ok, err := b.sameBoxEmpty(ctx, rt)(); !ok { |
| + t.Fatalf("before the acquire: %v", err) |
| + } |
| + l, err := b.Acquire(ctx, rt) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + releaseHALease(t, l) |
| + if ok, _ := b.sameBoxEmpty(ctx, rt)(); ok { |
| + t.Fatal("the same-box proof passed for a host this process acquired") |
| + } |
| + |
| + lb, lrt := haBackend(t, "legacy.example.com") |
| + sameBoxReady(lb) |
| + haFixOf(lb).records[lrt.Host] = haRecord(lrt.Host, false) |
| + lb.Lifetimes = nil |
| + ll, err := lb.Acquire(ctx, lrt) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + releaseHALease(t, ll) |
| + if ok, _ := lb.sameBoxEmpty(ctx, lrt)(); ok { |
| + t.Fatal("the same-box proof passed for a host this process acquired legacy") |
| + } |
| +} |
| + |
| +// expireLock is the TTL passing on the HA lock a dead agent left: the |
| +// same lock, expired a minute ago. |
| +func expireLock(t *testing.T, s *haSvc) { |
| + t.Helper() |
| + v := s.lockView(t) |
| + if v.Absent || v.Lock.Release != nil || !v.HAOn() { |
| + t.Fatalf("the dead agent left %+v", v) |
| + } |
| + expired := v.Lock |
| + expired.ExpiresAt = time.Now().Add(-time.Minute).UTC() |
| + body, err := json.Marshal(expired) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + s.fx.PutLock(s.b.Cfg.hibernatePrefix(s.rt.Host), body) |
| +} |
| + |
| +// servingUnit replaces s's start with one that keeps the serving socket's |
| +// stop, so the startup sweep can end the app a dead agent left running. |
| +type servingUnit struct { |
| + mu sync.Mutex |
| + stop []func() |
| +} |
| + |
| +func (u *servingUnit) sweep() { |
| + u.mu.Lock() |
| + defer u.mu.Unlock() |
| + for _, f := range u.stop { |
| + f() |
| + } |
| + u.stop = nil |
| +} |
| + |
| +func trackServing(t *testing.T, s *haSvc) *servingUnit { |
| + t.Helper() |
| + u := &servingUnit{} |
| + s.ctl.onStart = func() { |
| + if err := ensureDB(s.b.pathsFor(s.rt).dbPath); err != nil { |
| + t.Error(err) |
| + } |
| + s.unit.started("inv1") |
| + stop := serveOK(t, s.rt.Socket) |
| + u.mu.Lock() |
| + u.stop = append(u.stop, stop) |
| + u.mu.Unlock() |
| + } |
| + t.Cleanup(u.sweep) |
| + return u |
| +} |
| + |
| +// restartWithSweep is the agent restarted on the same box, after its |
| +// startup sweep: swept, root stopped every instance unit (the dead |
| +// agent's app among them) and proved each one gone, and the host's slice |
| +// reads empty; not swept, the sweep failed and the unit still runs. |
| +func restartWithSweep(t *testing.T, s *haSvc, u *servingUnit, swept bool) *haSvc { |
| + t.Helper() |
| + if swept { |
| + u.sweep() |
| + s.unit.stopped() |
| + } |
| + s2 := s.restart(t) |
| + s2.b.StartupSwept = func() bool { return swept } |
| + s2.b.sameBox.flatEvents = noFlatCgroup |
| + return s2 |
| +} |
| + |
| +// r3.5, through the service wake path: the agent dies with the host awake |
| +// and its unit outlives it. The restarted agent is refused until its |
| +// startup sweep has proven the unit gone, and then, once the lock has |
| +// expired, takes the host back on this box. |
| +func TestRestartedAgentRetakesNestedHostAfterExpiry(t *testing.T) { |
| + ctx := context.Background() |
| + s := haService(t, "shop.example.com") |
| + u := trackServing(t, s) |
| + if _, err := s.wakeForTest(ctx); err != nil { |
| + t.Fatalf("wake: %v", err) |
| + } |
| + // The crash: the agent never runs again, and its lock stops renewing. |
| + expireLock(t, s) |
| + |
| + // The sweep failed: the dead agent's unit may still write. |
| + unproven := restartWithSweep(t, s, u, false) |
| + _, err := unproven.wakeForTest(ctx) |
| + var refused *errLeaseRefused |
| + if !errors.As(err, &refused) || !strings.Contains(refused.reason, hafresh.ReasonSameBoxUnsure) { |
| + t.Fatalf("woken without the sweep's proof: %v", err) |
| + } |
| + if v := s.lockView(t); v.Lock.Owner == "" || !v.Lock.ExpiresAt.Before(time.Now()) { |
| + t.Fatalf("the refused wake wrote the lock: %+v", v.Lock) |
| + } |
| + |
| + before := len(lockWriteLogOf(s)) |
| + a2 := restartWithSweep(t, s, u, true) |
| + e, err := a2.wakeForTest(ctx) |
| + if err != nil { |
| + t.Fatalf("same box not recovered: %v", err) |
| + } |
| + if e == nil || e.state != actAwake { |
| + t.Fatalf("no awake entry: %+v", e) |
| + } |
| + w := lockWriteLogOf(s) |
| + if len(w) <= before || !isHAHeld(w[len(w)-1], a2.b.self()) || !s.lockView(t).Lock.ExpiresAt.After(time.Now()) { |
| + t.Fatal("the restarted agent did not take the host's lock") |
| + } |
| +} |
diff --git a/internal/activator/hasecrets_test.go b/internal/activator/hasecrets_test.go| index 191f6bd84..11b409bf0 100644 |
| --- a/internal/activator/hasecrets_test.go |
| +++ b/internal/activator/hasecrets_test.go |
| @@ -359,11 +359,11 @@ func TestFirstWakeCrashBeforePublishRemints(t *testing.T) { |
| t.Fatalf("another box took it: %v", err) |
| } |
| - // The same box restarts; its startup sweep proved every unit stopped. |
| + // The same box restarts; its startup sweep proved every unit stopped |
| + // (the fixture's StartupSwept), and the host's slice and flat cgroup |
| + // read empty: the real proof, sameBoxEmpty. |
| a2 := s.restart(t) |
| - a2.b.SetSameBoxProof(func(context.Context, registry.Route) func() (bool, error) { |
| - return func() (bool, error) { return true, nil } |
| - }) |
| + a2.b.sameBox.flatEvents = noFlatCgroup |
| var atSpawn string |
| start := s.ctl.onStart |
| s.ctl.onStart = func() { |
diff --git a/internal/activator/hawake.go b/internal/activator/hawake.go| index ff91867ed..a779944d0 100644 |
| --- a/internal/activator/hawake.go |
| +++ b/internal/activator/hawake.go |
| @@ -236,14 +236,6 @@ func (b *ExecBackend) restoredReplication(rt registry.Route) (string, bool) { |
| return b.haWakes.class(rt.Host) |
| } |
| -// SetSameBoxProof installs the same-box emptiness proof the HA acquire |
| -// hands lease (hafresh.Proofs.SameBoxEmpty) for a host this box's own |
| -// instance id last held and that expired. Nil, the default, refuses every |
| -// same-box takeover. Call it before the Service starts. |
| -func (b *ExecBackend) SetSameBoxProof(f func(ctx context.Context, rt registry.Route) func() (bool, error)) { |
| - b.sameBoxProof = f |
| -} |
| - |
| // self is this box's lease identity: Config.Self, else lease's own. |
| func (b *ExecBackend) self() hafresh.Self { |
| if b.Cfg.Self != nil { |
| @@ -322,10 +314,7 @@ func (b *ExecBackend) acquireClassified(ctx context.Context, rt registry.Route) |
| if err := b.haContained(rt); err != nil { |
| return nil, refusedUncontained(err) |
| } |
| - var proofs hafresh.Proofs |
| - if b.sameBoxProof != nil { |
| - proofs.SameBoxEmpty = b.sameBoxProof(ctx, rt) |
| - } |
| + proofs := hafresh.Proofs{SameBoxEmpty: b.sameBoxEmpty(ctx, rt)} |
| held, err := acquireHALease(ctx, b.Cfg.Bucket, prefix, b.Cfg.Region, hafresh.Marker{Lifetime: entry.ID}, proofs) |
| if err != nil { |
| return nil, leaseError(err) |