carlos / platform Public

region-ha p1b-2: the holder cache's map is holders, not entries (TestEntriesEnterThroughPutEntryLocked)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 1e58a678f459815eebd0491c0220e91b6f6dca8f parent e8c69ed
2 files changed, +10 −10
  • internal/activator/hacache.go +9 −9
  • internal/activator/haforward_test.go +1 −1

CI failed — run details

Intent

Human

<task-notification> <task-id>bqb0wi82y</task-id> <tool-use-id>toolu_01EvbWG1uY8oF3mn6TAk9eJe</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/953e7524-2e06-4308-b9ce-fd1b38579971/tasks/bqb0wi82y.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on the merged tip" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 13.8 g CO₂e (1,837,501 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on region-ha-p1b2-forwarding, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/internal/activator/hacache.go b/internal/activator/hacache.go
index ca45c9ea8..c1b73ded7 100644
--- a/internal/activator/hacache.go
+++ b/internal/activator/hacache.go
@@ -31,7 +31,7 @@ const (
type holderCache struct {
mu sync.Mutex
now func() time.Time
- entries map[string]*list.Element // host -> *holderEntry in order
+ holders map[string]*list.Element // host -> *holderEntry in order
order list.List // oldest set at the front
flights map[string]*holderFlight // host -> the lock read in flight
}
@@ -68,7 +68,7 @@ func (c *holderCache) get(host string) (ref string, positive, found bool) {
}
func (c *holderCache) getLocked(host string) (string, bool, bool) {
- el := c.entries[host]
+ el := c.holders[host]
if el == nil {
return "", false, false
}
@@ -103,7 +103,7 @@ func (c *holderCache) setNegative(host string) {
func (c *holderCache) drop(host string) {
c.mu.Lock()
defer c.mu.Unlock()
- if el := c.entries[host]; el != nil {
+ if el := c.holders[host]; el != nil {
c.removeLocked(el)
}
if f := c.flights[host]; f != nil {
@@ -115,24 +115,24 @@ func (c *holderCache) putLocked(host, ref string, ttl time.Duration) {
if f := c.flights[host]; f != nil {
f.stale = true
}
- if c.entries == nil {
- c.entries = map[string]*list.Element{}
+ if c.holders == nil {
+ c.holders = map[string]*list.Element{}
}
expires := c.clock().Add(ttl)
- if el := c.entries[host]; el != nil {
+ if el := c.holders[host]; el != nil {
e := el.Value.(*holderEntry)
e.ref, e.expires = ref, expires
c.order.MoveToBack(el)
return
}
- for len(c.entries) >= holderCacheMax {
+ for len(c.holders) >= holderCacheMax {
c.removeLocked(c.order.Front())
}
- c.entries[host] = c.order.PushBack(&holderEntry{host: host, ref: ref, expires: expires})
+ c.holders[host] = c.order.PushBack(&holderEntry{host: host, ref: ref, expires: expires})
}
func (c *holderCache) removeLocked(el *list.Element) {
- delete(c.entries, el.Value.(*holderEntry).host)
+ delete(c.holders, el.Value.(*holderEntry).host)
c.order.Remove(el)
}
diff --git a/internal/activator/haforward_test.go b/internal/activator/haforward_test.go
index 27a38dd46..226c5d6d9 100644
--- a/internal/activator/haforward_test.go
+++ b/internal/activator/haforward_test.go
@@ -212,7 +212,7 @@ func TestHolderCacheBounds(t *testing.T) {
for i := range holderCacheMax + 1 {
c.set(fmt.Sprintf("h%d.example.com", i), "b")
}
- if n := len(c.entries); n != holderCacheMax {
+ if n := len(c.holders); n != holderCacheMax {
t.Fatalf("%d entries, want %d", n, holderCacheMax)
}
if _, _, found := c.get("h0.example.com"); found {