Skip to content

keyed harness: break a stale build cache that shipped six identical images - #2897

Merged
Flotapponnier merged 1 commit into
mainfrom
fix/bust-stale-build-cache
Oct 8, 2026
Merged

Flotapponnier merged 1 commit into
mainfrom
fix/bust-stale-build-cache

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

keyed harness: break a stale build cache that shipped six identical images

Two merges to main (#2895, #2896) each triggered a build that reported SUCCESS,
and the container really was replaced: /proc/1 showed a boot at 18:21:35 and
pid 1 was /app/monitor. But grepping the running binary for symbols from both
commits returned zero on all four of them. The builder was serving a cached
image whose COPY . . layer predated the changes, so six deployments shipped
the same binary.

A BUILD_REF arg between the source copy and the go build gives the layers below
something that changes. The echo is there so the arg is actually consumed; a
bare ARG is not a cache key.

Also recording the diagnostic that cost an hour, because it will recur: the
binary's mtime is NOT a way to tell whether a deploy landed. It comes from the
image layer, so it reads old even in a container that booted a minute ago. I
read 16:35 six times and concluded nothing was deploying, which was wrong — the
containers were fine, the image was stale. Grep the running binary for a string
you just added. That is the test that works.

…mages

Two merges to main (#2895, #2896) each triggered a build that reported SUCCESS,
and the container really was replaced: /proc/1 showed a boot at 18:21:35 and
pid 1 was /app/monitor. But grepping the running binary for symbols from both
commits returned zero on all four of them. The builder was serving a cached
image whose `COPY . .` layer predated the changes, so six deployments shipped
the same binary.

A BUILD_REF arg between the source copy and the go build gives the layers below
something that changes. The echo is there so the arg is actually consumed; a
bare ARG is not a cache key.

Also recording the diagnostic that cost an hour, because it will recur: the
binary's mtime is NOT a way to tell whether a deploy landed. It comes from the
image layer, so it reads old even in a container that booted a minute ago. I
read 16:35 six times and concluded nothing was deploying, which was wrong — the
containers were fine, the image was stale. Grep the running binary for a string
you just added. That is the test that works.
@Flotapponnier
Flotapponnier merged commit fd7b756 into main Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant