Repository navigation
EN Clever Redeploys
Français · Type: explanation + how-to · Audience: admin · Context: hosted Studio · Status: ready · Applies from: 4.2.3
The Studio Server (hosted team Studio) · contract: experimental · verified by CI (support matrix of 4.4.0, 2026-10-23): Postgres, S3 and Keycloak in CI; Chromium and Firefox (job studio-hosted); WebKit on macOS, by hand only · automated checks: jobs
studio-hosted,studio-install-smoke; CI planstudioHosted; 3 test files · people's passes:studio-hostednot run (#149),studio-collabnot run (#150),studio-previewnot run (#166),studio-assets-hostednot run (#167),studio-mcp-remotenot run (#196),studio-oidc-genericnot run (#197) · known limits:client-retry
On Clever Cloud a deploy (or a push, or clever restart) starts the new instance while the old one still serves. The
Studio Server is built for that overlap: no write is lost, but writes are slow or refused for about a minute. This page
says why, what was measured, and how to deploy so that members are not surprised.
Spike S measured it on 17 October 2026: during clever restart --without-cache, the new instance started while the
old one still answered, and the old one never logged a SIGTERM. Two instances writing the same game at once would
corrupt its history, and waiting for a signal that does not come would stall the switch. So:
- The instances share a service lease in PostgreSQL: one holds it and serves writes. It lasts 30 s and is renewed every 10 s on the database's clock; an instance that cannot renew stops writing by its own clock before the 30 s can pass.
- The new instance starts, answers
/startz(Clever's health check,CC_HEALTH_CHECK_PATH=/startz), then waits:/readyzis 503 ("writes":"waiting") and its writes are 503 withRetry-After: 2("this instance does not serve writes yet; try again"). -
The handoff (since 4.2.3). Once it listens, the new instance asks for the lease; the holder gives it back at its
next renewal (10 s at most) and logs
{"event":"lease-lost",…}; the new one logs{"event":"lease-taken",…}. An older instance never takes the lease back from a newer one. - A client retries a refused write with the same operation id (
X-Studio-Op) and it is applied once. The journal's own fenced lease still keeps two instances from writing over the same head.
Clever Cloud keeps the old instance STOPPING for about two minutes, still receiving requests until the deploy ends,
and it logs no stopping line.
Measure ·
handoff-windowBetween two versions that both hand the lease over (twoclever restartof the same commit):lease-taken6.0 s and 10.1 s after the new instance listened; then writes were 503 (Retry-After: 2) for 16 s and 10 s, because Clever still sent requests to the old instance, which no longer held the lease, until the deploy ended. Before that, while the new instance started, one write waited 10.2 s and 19.4 s on its journal check and got a 503 too, then went through on a retry. No 409, no 500, no write applied twice.
- date: 2026-10-19
- version: 4.2.2
- volume: two redeploys, a probe reading
/readyzevery second and writing a note every 3 s- conditions: reference deployment, studio app XS, one instance, PostgreSQL DEV, region par; engine at commit dd66b38d on main before the 4.2.3 tag (package.json said 4.2.2); one sample per deploy
- source: QUALIF-4.2.3-REFERENCE.md §5 bis
In all, about a minute of slow or refused writes per deploy, none lost.
Measure ·
first-deploy-onto-handoffThe first deploy onto a version with the handoff, from one without it (4.2.2, or a 4.2.3 commit before #183): the old version kept the lease until Clever stopped it, and writes were refused for 2 min 23 s and 2 min 27 s, reads going on.
- date: 2026-10-19
- version: 4.2.2
- volume: two deploys (52e68932 → c66fbf56, then c66fbf56 → dd66b38d), the same probe
- conditions: reference deployment, studio app XS, PostgreSQL DEV, region par; engine commits on main before the 4.2.3 tag (package.json said 4.2.2)
- source: QUALIF-4.2.3-REFERENCE.md §5 and §5 bis
While both instances run they hold twice the connections: on the PostgreSQL DEV plan (5) background work fails with "too many connections" during each deploy, and an older version's write could fail with it (a 500). Take a larger plan for a deployment people use (Apps and add-ons).
Verified on: 19 October 2026 (the measures above; engine commits before the 4.2.3 tag, package.json 4.2.2). This page's text itself is not verified on a live installation.
- Tell the members, or pick a quiet moment: about a minute of slow writes; about two and a half minutes of refused writes for the first deploy onto 4.2.3 or later from an older version.
-
Deploy from your machine, in the engine repository, the worker first when both change:
# on your machine, in the engine repository clever deploy --alias my-game-worker clever deploy --alias my-game-studio
-
Watch
/readyzcome back to 200 and thelease-takenline (itsinstanceis the new one):# on your machine until curl -sf https://studio.example.fr/readyz; do sleep 2; done
- Make one write (a note) and see it saved, at the next revision.
Limit ·
client-retry"None lost" holds for a client that retries a 503 with the same operation id. The Studio in the browser does, up to 8 tries with waits growing to 8 s (about 40 s in all), so a window longer than that (the first deploy onto the handoff) ends in a refusal it shows. The local MCP's tools pointed at a hosted Studio send an operation id but do not retry: they report the 503, and the tool is run again. A script of your own that does not retry loses the write it sent during the window.
- Relying on SIGTERM to hand the lease over: Clever never delivered it observably (spike S, the reference deployment).
-
Stopping the old instance first (
clever stop, then deploy): a minute or more with no Studio at all. Kept for one case only, a migration that changes what the old version reads (Upgrading the server). - Several instances serving at once: the journal needs one writer per game.
The handoff shortens the refused window from minutes to seconds, but Clever's routing to the old instance until the
deploy ends keeps 10 to 16 s of 503. A /readyz alert must tolerate that (Monitoring).
- The lease:
studio-server/src/server/service-lease.ts(master plan §4, P8); ADR 0025. - The measures:
docs/dev/SPIKE-4.2.1-CLEVER.md§2,docs/dev/QUALIF-4.2.3-REFERENCE.md§5 and §5 bis. - A 503 seen by a member: Troubleshooting.
Generated publication · publication générée — current documentation · documentation courante: quest'n'click 4.4.0 r1, documentation revision · révision de la documentation 8dc717c69acb62c4742b69c54a7e7dfb620f75d8.
Earlier versions and permalinks · versions précédentes et liens permanents: https://wanoo.github.io/quest-n-click/docs/
An edit made in this wiki is overwritten at the next publication · une modification faite dans ce wiki est écrasée à la publication suivante.
Edit the source · Modifier la source · Report an error · Signaler une erreur
Index (6)
Start (6)
Play (9)
Install (17)
- Requirements
- Install from the release archive
- Install from npm, once published
- Install from the repository to work on the engine
- doctor: checking your machine
- Image toolchain
- Audio toolchain: ffmpeg, fluidsynth, Furnace, uv
- Upgrade
- Upgrade notes: 4.4
- Upgrade notes: 4.3
- Upgrade notes: 4.2
- Upgrade notes: 4.1
- Upgrade notes: v3
- Upgrade notes: v2 to v3
- Coming from web-scumm
- Package reference
- Install troubleshooting
Create a game (55)
- Your first game
- Layout of a created project and of the engine repository
- The working loop
- Content principles and the identity contract
- Rooms
- Geometry: placement, walk zones, masks, layers, camera
- Something is visible but unreachable
- Reactions
- Game commands
- Conditions
- Flags, variables and events: which to use
- Custom code
- Characters
- Items and inventory
- World map
- Dialogues
- Scripts and events
- Moving characters: patrols and walks
- Exits
- Chapters and objectives
- State and saves: persistent or temporary, renaming an id, migrations
- Staging: wide rooms and animations
- The stage: lights, particles, floors
- Skin and fonts
- Title and credits
- Heroes: several characters and hero choice
- Built-in minigames
- A custom minigame
- Translations
- Music in stems
- Sound effects
- Voices: per language and per hero
- Images: prompts, cutting sheets, transparency, scale
- Asset provenance
- The storyboard, source of truth
- Puzzle design
- Classic mechanics
- Review pages
- DSL reference
- Checking your game
- What the solver proves
- Solver options
- Playtests
- Remix
- Speedrun for authors
- The sealed ending
- Production template
- Example games
- Working with an AI
- Build and release a game
- Publish on GitHub Pages
- The static game on Clever Cloud
- Other static hosts
- Sub-path, cache and service worker, incomplete deploys, going back
- Testing on a phone over the LAN
Local Studio (24)
- The local Studio: overview and launch
- Edit a room
- Placement and stage
- Preview, apply, undo
- Storyboard
- Assets and cutting
- Check: validator, solver, critical path, heat, health, coverage
- Before and after captures
- Semantic diff
- Play and replay a session
- Rule explainer
- Language and objectives
- Voices and the heroes × languages matrix
- Map
- Notes
- Remix in the Studio
- Music
- The Assistant: bring your own key
- Demo mode and studio-apply
- Local and LAN security
- Studio API
- Local MCP: setting up each client
- MCP tools
- Studio troubleshooting
Team Studio (21)
- What runs where
- Concepts: revision, transaction, span, lease, preview, build
- Starting as an invited dev
- Working together day to day
- Roles and actions: the full matrix
- Invitations
- Managing members
- Write refused on the hosted Studio: stale base revision (409)
- Write refused on the hosted Studio: span locked (423)
- Recovering after a lost lease, a disconnection or a stale preview
- Comments
- Map and semantic diff
- Publishing builds
- Remote MCP
- The game in Git
- Upgrading the engine of a hosted game
- Hosted assets
- The server's command line
- Health and metrics routes
- Trying it locally with compose.yml
- Known limits
Clever Cloud (23)
- Clever Cloud: overview, cost and prerequisites
- Apps and add-ons
- Domains and TLS
- Keycloak
- Generic OIDC and GitLab
- Configuration
- First deployment
- Backups
- RPO and RTO
- Restore the Studio on a fresh installation
- Redeploys
- Upgrading the server and checking state after a migration
- Limits of going back
- Monitoring
- Security
- Rotating keys
- Recovering admin access
- Changing domain or OIDC provider
- Worker, PostgreSQL or Cellar down
- Exporting the game and leaving the installation
- Retention
- Clever Cloud troubleshooting
- Costs and teardown
Reality Bridge and connectors (16)
- The Reality Bridge: what it is
- Quick start
- Guarantees
- Install and run the Bridge
- Backup and restore
- Several tenants
- Signals and the manifest
- The Bridge's command line
- Connectors overview
- Email connector
- Telnet connector
- SSH connector
- Open Badges connector
- The connector SDK
- Security: Biscuit and signatures
- Bridge and connector troubleshooting
Contribute (25)
- Welcome
- Developer setup
- The dev loop
- Before a pull request
- Conventions
- Writing documentation
- Architecture
- Code tour
- Import boundaries
- Which tests run when
- Mutation testing
- The coverage ratchet
- The quality baseline
- CI explained
- Field passes
- Benchmarks
- Releasing
- npm packages
- Decisions and ADRs
- Governance
- Bot pull requests
- Contributing with AI agents
- Security policy
- Code of conduct
- Licences and credits