Repository navigation
Description
Symptom
Bed steps that shell out to podman images become unboundedly slow on a long-lived host, with no
error naming the cause. charly check box and charly remove both appear to hang: the run
directory stays empty, no log line is written, and the only visible child process is
podman images --format json
Measured on this workstation: a single check-image step sat for 25+ minutes in that call. It
did eventually complete — so this is degradation, not deadlock, which is what makes it hard to
recognise. My own first diagnosis was "blocked on the container-storage lock", and that was wrong.
Root cause
The image store had 10,865 images, of which 10,607 were untagged (97.6%), occupying 334 GB.
$ podman ps → instant (13 containers)
$ podman images → times out
$ podman system locks → "No lock conflicts have been detected."
Not contention — podman images is O(n) over the image set, and charly calls it inside steps that
are otherwise sub-second.
Where they come from: disposable beds do not reap the intermediate images their builds create.
Age-bucketing the untagged set on a host running two concurrent agents:
<6h: 4773
6-24h: 1979
1-7d: 3808
≈800 untagged images per hour of bed activity, retained indefinitely. disposable: true
removes the container and the tagged image; the intermediates survive.
Why it is worth fixing rather than papering over
- The failure is silent and misattributed. There is no message, so the natural reading is "the
bed is hung" or "the host is contended", and the actual cause is invisible without going to
overlay-images/images.jsondirectly. - It degrades every bed on the host, not just the one that filled the store, so it presents as
flakiness in unrelated work. - The obvious operator response —
podman image prune -f— destroys charly's layer cache, so
the cure slows every subsequent build. A prune filtered tountil=24hkeeps the warm cache, but
an operator has to know that. - The prune itself must enumerate the same set first, so once the store is large enough the
remedy is as slow as the symptom.
Suggested directions (not a prescription)
- Reap on teardown. A
disposable: truebed knows exactly which intermediates it created;
removing them at cleanup is bounded work at the point of creation rather than unbounded work
later. - Bound the call. Where charly needs a specific image,
podman images --filter reference=…
is O(matches), not O(store). The unfiltered--format jsonenumeration looks avoidable at
several call sites. - Fail loudly on a degraded store. If the call exceeds a threshold, say so — "the image store
holds N images; this step is enumerating all of them" turns a 25-minute mystery into a
one-line diagnosis.
Environment
charly dev build; podman overlay driver, transient=true; two concurrent agents running beds.
Assisted-by: Claude Code claude-opus-5[1m] (analysed on a live system)
Activity
atrawog commentedon Aug 30, 2026
Correction — my "unreaped garbage" premise was wrong
I filed this with the framing that ~97.6% of the store was garbage the beds failed to reap. That
part is not supported, and I am retracting it.
The test that disproved it was the fix itself:
I had predicted ~3,808 removals from age-bucketing
createdinoverlay-images/images.json.Podman removed 137. Podman's "dangling" means untagged and unreferenced, so the untagged
bulk is not reclaimable — those entries are the layer graph backing the 256 tagged images, i.e.
charly's build cache, not litter. My age-bucketing also read a
createdfield that evidentlyis not what podman filters on; I did not verify it before drawing a conclusion from it.
So "disposable beds leak ~800 images/hour" should be read as unverified. Beds may well be
reaping correctly and the store may simply be the honest cost of a warm cache across many boxes.
What survives, still measured
A
check-imagestep sat 25+ minutes inpodman images --format jsonand then completed. That isreal, and it is not lock contention.
What that changes about the fix
Suggestion 1 (reap on teardown) rests on the retracted premise — disregard it unless someone
confirms the leak independently.
Suggestion 2 is now the whole point, and is stronger for it: if the untagged bulk is legitimate
cache, then it is supposed to grow, and the only durable answer is for charly not to enumerate
the whole store.
podman images --filter reference=…is O(matches); the unfiltered--format jsoncall is O(store) and appears avoidable at the call sites that want one known image.Suggestion 3 (say so when the call is slow) also stands, and this episode is the argument for it:
the absent diagnostic cost me two wrong root causes in a row — first "storage-lock contention",
then "unreaped garbage" — before the prune's own result contradicted me.
Operator note for anyone hitting this meanwhile:
prune --filter until=24hwill not reclaimmuch, because the store is mostly referenced. Reclaiming it means removing tagged images you no
longer want and letting their ancestry go with them — which is a cache decision, not a cleanup.
Assisted-by: Claude Code claude-opus-5[1m] (analysed on a live system)
[-]Beds do not reap intermediate images; charly's own `podman images` calls then degrade silently[/-][+]charly's unfiltered `podman images` enumeration degrades every bed on a large store[/+]atrawog commentedon Aug 30, 2026
Correcting the root cause in this issue — it is mine, and the measurements disprove it. Fix in opencharly/spec#76.
I set out to implement what this issue proposes (avoid the unfiltered enumeration, filter dangling) and measured first. Both halves collapse:
Filtering dangling images is 50% slower — the filter costs more than the 402 rows it removes. The "10,607 untagged (97.6%)" figure does not describe this store.
Where the cost actually is: 1,170 image IDs carrying 12,585 tag names across 177 repositories.
I also tested the next plausible cause — that retention is blind to them, since
charlyImageTagsskips images withoutai.opencharly.box:So the store is not full of junk retention cannot see. It is full of accumulated CalVer tags retention has not pruned — an operational matter, not an enumeration bug.
What #76 therefore fixes is the symptom this issue actually reported: a slow store presenting as a silent stall. The call is bounded (process group killed on expiry) and names the cause instead of sitting for 25 minutes with no log line, and a completed-but-slow listing now reports its own cost. It deliberately does not claim to make a large store fast — the enumeration is inherently O(store), and the 5-minute cache above it is what keeps repeat calls cheap.
Leaving this open until #76 merges; the remaining question after that is retention policy for the tag accumulation, which is a separate matter from enumeration.
atrawog commentedon Aug 30, 2026
Closing — the reported symptom is fixed in opencharly/spec#76 (merged, on main).
To recap what actually turned out to be true, since this issue's original root cause was mine and wrong:
ai.opencharly.box, socharlyImageTagscan see essentially all of them.So there was no enumeration bug to fix. What there was, and what #76 fixes, is that an O(store) call with no bound and no log line is indistinguishable from a hang — the 25-minute observation that prompted this issue. It is now bounded, kills the process group on expiry, and names the cause:
and a completed-but-slow listing reports its own cost, so a growing store is visible before it becomes a mystery.
The tag accumulation is not a defect.
charly cleanwithdefaults.keep_imagesis the mechanism, and it is an explicit operator command by design — pruning images is destructive and should not happen behind someone's back. On this workstation it simply had not been run.Nothing left open here that is a bug. If unbounded growth between
charly cleanruns turns out to be worth changing, that is a retention-policy decision rather than an enumeration fix, and deserves its own issue stating the policy it wants.