app: a bundled release boots the service, this application then does not (#16) #17
Loading…
Reference in a new issue
No description provided.
Delete branch "hygiea/16-bundle-member"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The bundled switch (C7) for macula-services/mcl-stations#16, in the one shape Mars ruled for the wave (mail#31's): the application always starts its own supervisor,
bundled=trueskips only the application's ownmcl_om:boot, andmcl_stations_service:start/1is idempotent.mcl_stations_app:start/2startsmcl_stations_supin both shapes, and the application's own process is that supervisor. Bundled, the hosting release's onemcl_om:boot([...])list calls the service'sstart/1, which answers{ok, Pid}with the supervisor that is already running rather than{error, {already_started, _}}; standalone, this application runs the boot itself exactly as before. The boot's own answer is checked against the supervisor this application started, so a service that built a second tree fails the start by name instead of hiding it.r=2 replaces my first shape — a holder process, and no local supervisor when bundled — which Jupiter found divergent from the other services.
Five mutants, each red on its named test: bundled also boots; standalone stops booting; the switch never reads the env; the application stops asking for its supervisor;
start/1stops being idempotent. Two lessons from running them: a mutant the compiler refuses (an unused function) proves nothing about the test, so M2 keepsbooted/2reachable; and a failed compile leaves the previous beam, so the runner deletes the four beams before each mutant rather than running yesterday's.Still held for the last commit, per Mars on 2026-12-02, because all of it needs mcl_om 1.9 and hex tops out at 1.8.0:
orgininfo/0(C6); themcl_om.orgliteral leavingconfig/sys.config.src(C9); the floor test at 1.9.0 with the pin at~> 1.9(the lock is gitignored here; CI files the tested resolve); and theingest_node_recordssingleton wrap (A3 package 4). Until then the env literal stays, which is what keeps the standalone release booting with an org on 1.8.Refs #16.
Local, OTP 28.4.3, all green:
rebar3 lint,rebar3 xref,rebar3 eunit(140 tests),rebar3 dialyzer,rebar3 as prod release.mcl_stations_app:start/2 now reads {mcl_stations, [{bundled, true}]} from app env. Set, it starts nothing: the hosting release's one mcl_om:boot([...]) list starts this service's supervisor, and a second start here would be a name clash on mcl_stations_sup. Absent -- every deployment that exists today, and this service's own release -- it calls mcl_om:boot(mcl_stations_service) exactly as before. The switch's two arms take the boot as a function, so the tests prove both without booting mcl_om: a real boot wires a mesh pool against a realm and stations a node, which is not something a unit test may do. Three mutants (bundled boots, standalone does not boot, the switch always false) each turn the matching test red. Part of macula-services/mcl-stations#16 (C7, macula-services/mcl-om#8): the org from info/0, the ingest_node_records singleton wrap and the ~> 1.9 pin follow in the last commit, once the 1.9.0 release exists.Jupiter found two C7 shapes in the wave; Mars ruled one for all six, mail#31's. This is mcl-stations on that shape: - start/2 ALWAYS starts this service's supervisor, in both shapes, and the application's own process is that supervisor. Bundled, the hosting release's one mcl_om:boot([...]) list no longer starts a tree under whatever process ran the boot: its call to mcl_stations_service:start/1 finds this one running and answers with it. - bundled=true now skips one thing only, this application's own mcl_om:boot/1. - mcl_stations_service:start/1 is idempotent: a second call answers {ok, Pid} with the running supervisor instead of {error, {already_started, _}}, which is what would have refused the bundle's boot. The boot's answer is checked rather than trusted: with an idempotent start/1 it must be the supervisor this application started, so a different pid is a second tree and start/2 fails naming it. Tests: five mutants, each turning its named test red -- M1 bundled also boots, M2 standalone stops booting, M3 the switch never reads the env, M4 the application stops asking for its supervisor, M5 start/1 stops being idempotent (logs under ~/.claude/sessions/hygiea-stations/mutants-r2/). Two mutant lessons worth keeping: a mutant the compiler refuses (an unused function) proves nothing about the test, so M2 keeps booted/2 reachable; and a failed compile leaves the previous beam, so the runner deletes the four beams before each mutant or the suite runs yesterday's mutant. Refs macula-services/mcl-stations#16, macula-services/mcl-om#8.Landed by fast-forward: main is
12b164d958(from734d2285). This repository does not allow the manually-merged style, so the PR is closed by hand.Pull request closed