Repository navigation
Name the standing container application so the Durable Object class rename modifies it - #392
Conversation
|
That is the second consecutive failure and confirms the durable-cause reading in the PR body — the run before it, 34094193513, was the first after #380 landed, and every run since reads the same Run history
#380 is the commit that introduced the |
## Summary - raise the public Leaf container ceiling from 10 to 100 concurrent private sessions - add deployment-config tests that pin the explicit Cloudflare application identity, align the container and Durable Object binding classes, and retain the public-session capacity floor - run those guards in the Worker-specific pull-request gate using the same TOML parser Wrangler uses - make post-deploy verification tolerate a realistic cold start, stay within the job budget, and print Cloudflare response bodies on failure ## Why #392 restored deployment by explicitly naming the standing container application, safely decoupling that external identity from the renamed TypeScript class. Its rollout then exposed the next production boundary: `https://leaf.page/api/state` returned `Maximum number of running container instances exceeded` because the example-only ceiling of 10 now applies to every product-page reader. The verification job retried for ten minutes but discarded that response body, leaving only timeouts and opaque HTTP 500 lines in the log. The higher ceiling keeps a hard cost bound while allowing 100 concurrent private Leaf sessions. The new tests catch a lost application name, a container/binding mismatch, or a return to the example-only capacity in pull-request CI. Verification now allows 25 seconds per cold-start attempt, keeps the two-probe worst case below the 30-minute job timeout, and emits the final error body. ## Testing - `npm run typecheck --prefix worker` - `npm test --prefix worker` — 21 passed - `uv run pre-commit run --all-files` - `uv run scripts/site.py` - `npx wrangler deploy --dry-run --containers-rollout=none --outdir <temporary-directory>` - local execution of the verification curl/jq path against the live preview > _This was written by Codex on behalf of max-sixty_
Problem
publish-sitewent red onmainat run 34094193513. The worker version uploaded fine;wrangler deploythen failed applying the container application:#380's
v2migration renamed the Durable Object classLeafExampleSession→LeafWebsiteSession, which preserves the namespace but changes the name wrangler derives for the container application. Wrangler looks the deployed application up by name and creates a new one when the lookup misses, so it asked Cloudflare for a second application against a namespace that already holds one — and a namespace can hold only one. The deploy log shows it taking that branch:NEW leaf-website-leafwebsitesessionagainstdurable_objects.namespace_id = "1dd7cf01600744e19eda64939aaf932d", the namespace the rename carried over.This is durable, not a capacity blip: every
publish-siterun since #380 hits the same wall, because the rename is in the config each of them reads.Solution
Name the standing application in
[[containers]]. That is the one knob wrangler consults before deriving a name, so the lookup hitsleaf-website-leafexamplesession, the deploy takes the modify-and-roll-out path, and the container picks up the image the run just built. The comment beside it records why the name lags the class: renaming an application means deleting the existing one first, which drops every seated reader session, so it is a maintainer's call rather than a deploy-time one.The site is serving 500s, and this fix alone will not settle that
Independent of the deploy,
https://leaf.page/currently answersFailed to start container: Maximum number of running container instances exceeded— three fresh-cookie probes at 07:33 and 07:37 UTC, each ~11.5s. #380 routed every product page through the container, so the homepage now takes a seat per reader againstmax_instances = 10withsleepAfter = "10m"; before it, only/examples/<slug>did. This PR unblocks the rollout, which will recycle the held instances, but the ceiling underneath is the same one #377 measured and left for a maintainer to weigh.Testing
Evidence
Wrangler's own lookup, from
worker/node_modules/wrangler/wrangler-dist/cli.js— by name, with the derived name only as a fallback:A hit takes the
modifybranch withid: application.id; a miss takesNEW, which is what the failed run printed.The name now resolves to the standing application, read back out of a dry run (no Docker in this environment, so the container rollout is skipped):
Live probes, three fresh sessions:
The worker gate passes:
npm run typecheckclean,npm test19 passed.python3 -m tomllibparses the config.publish-siteruns only on pushes tomain, so this branch's CI cannot exercise the changed deploy; merging it re-runs the workflow, sinceworker/**is in its trigger paths.Automated fix for failed run