Start one icons server per environment, and register it only once it answers - #6074
Open
backspace wants to merge 2 commits into
Open
Start one icons server per environment, and register it only once it answers#6074backspace wants to merge 2 commits into
backspace wants to merge 2 commits into
Conversation
…answers In an env-mode CI stack start-icons.sh ran twice for the same environment: once as the listed services:icons task and once spawned by services:realm-server, which starts it so that dev-all — whose run-p list has no services:icons — still gets an icons server. Each run picked a free port, backgrounded http-server, and wrote the environment's one icons route file straight away, so the second run's port replaced the first's whether or not its server ever came up. In one host shard the second http-server never did: the route pointed at a port nothing listened on, Traefik answered 502 for every icon without CORS headers, the standby pages could not import an icon module, and every base render timed out idle for the rest of the run while the first server sat unused after wait-on's single probe. The script now reads the port from any existing route file and steps aside when that server answers a dist file, so whichever task starts second leaves one server registered. It registers only after its own http-server answers, and exits non-zero without writing a route if the server dies or never answers, so a route can no longer name a dead upstream. The probe goes to the port directly, as Traefik does, rather than through the hostname, so it depends on nothing but the server being up. When the server later exits, the script removes the route it wrote, so Traefik answers 404 for a missing route rather than 502 for a dead one and the next start registers afresh instead of stepping aside. The route directory is resolved once in the shell and handed to the registration script instead of being re-derived there. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91c43cae52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A start that found the registered icons server answering exited, on the strength of one probe. When a stack starts while the previous one is still shutting down, that probe finds the old server alive; both of the new stack's starts exit, the old server then goes away and takes its route with it, and the new environment has no icons server for wait-on to ever see. The instance now stands by instead: it keeps probing the registered port and, the moment that server stops answering, starts and registers a server of its own. The environment therefore never ends with a route and nothing behind it, whichever stack the answering server belonged to. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
habdelra
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
packages/realm-server/scripts/start-icons.shis started by more than one task for the same environment:services:iconson its own, andservices:realm-server, which spawns it so thatdev-all(whoserun-plist has noservices:icons) still gets an icons server. Both registericons.<slug>.localhostthrough the one route file for the environment, last writer winning. In env mode the script now:mise-tasks/services/realm-servergains a comment saying why it spawns icons and how the script keeps that from doubling up.Why
A route that names a port nothing listens on is indistinguishable, from a browser, from a missing route: Traefik answers 502 with no CORS headers, the console reports a CORS failure, and no service log records the request. The host app cannot render a card without its icon modules, so every render times out idle. The
traefik-diagnosticsartifact now reports such a port asNOT LISTENING; this change stops the route from being written in the first place.Test plan
CI Host on this PR ran the real stack, where both
services:iconsand the realm-server's spawn start the script. In a host shard's log:start:iconsregisteredicons.ci.localhoston its port only after its http-server answered the probe file.The remaining paths were exercised against a Traefik with a test environment slug: a start whose http-server dies before answering exits 1 without writing a route; when the serving http-server exits, its script removes the route and the standby instance starts a replacement, registers its own port, and answers.
🤖 Generated with Claude Code