Skip to content

deploy: main is 80 commits ahead of production, including both container fixes from #120 #168

Description

@wormeyman

pnpm run verify:deploy on 2026-08-05:

live:  21e8ccc  built 2026-08-03T00:08:11.893Z
local: 7dc1eb0

80 commits. Nothing has shipped since 2026-08-03.

Why this is not just staleness

Two of the unshipped commits are the container fixes from #120:

commit
343df53 fix(container): handle SIGTERM - node is PID 1 and was ignoring it
8272192 fix(container): don't read PORT - the base image sets it to 34197

The SIGTERM one is the reason the instance never slept. Billing showed it awake
100% of every full day from 2026-07-20 through 2026-08-03 - 352 of 352 five-minute
buckets across one 29.3-hour stretch, on a total of 5 worker requests. @cloudflare/containers
stops an idle instance with SIGTERM and never escalates to SIGKILL, so with node as PID 1
and no handler the stop request was silently discarded.

9aa5a8f fix(preview): stop the container from being billed 24/7 (#116) (the
standard-1 -> basic downsize) is also in the unshipped range.

The ambiguity to resolve first, before deploying anything

The PORT bug was introduced by #154 and fixed by #159, and BOTH are in the unshipped
range.
So the live container is in one of two states and they need different urgency:

  • A container deploy happened between 343df53 and 8272192 -> production preview is
    down (server binds 34197, the runtime's 20s wait times out, 502s).
  • No container deploy since 2026-08-03 -> preview works, but the instance still never
    sleeps and may still be on standard-1.

verify:deploy cannot distinguish these - it checks the app bundle, and the
worker/container ship through preview:deploy. Settle it from the billing metrics, not
from wrangler containers instances (which reported state: running with an 80-minute-old
timestamp during an hour when allocation was zero - it describes the placement, not what
you are paying for):

  • Query containersUsageAdaptiveGroups.
  • Read the disk-to-memory ratio in bytes: 1.86 = standard-1 (4 GiB / 8 GB),
    3.73 = basic (1 GiB / 4 GB). The 2.0 / 4.0 figures in the dashboard are the same
    two numbers in mixed GiB/GB units.
  • Wait at least an hour before reading absence as sleep - the dataset backfills, and a
    bucket that has not landed is indistinguishable from an idle instance. This exact
    mistake produced the "~8.5 minute idle tail" in preview: the container NEVER sleeps - node is PID 1 and ignores SIGTERM (the "~8.5min idle tail" was a metrics backfill artifact) #120 that turned out not to exist.
    Confirm continuity with placementId, never with bucket presence alone.

Deploying

App and preview service are separate paths:

pnpm run deploy          # verify + build + wrangler pages deploy  (gated on verify)
pnpm run preview:deploy  # worker + container; needs Docker (gated on require:docker)

deploy runs the full verify first, so it will refuse a broken tree. Confirm afterwards
with pnpm run verify:deploy - do not grep the live bundle, that produced a false
negative once when the minifier turned a version string into a numeric array.

Also worth deciding

Whether "80 commits behind" should be able to happen silently. There is no check that the
live stamp is within N commits of main, and /version.json already exposes everything
such a check would need.

Related: #120, #116.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions