One release hosts several services, and a singleton helper (#8) #10

Closed
saturnus wants to merge 0 commits from saturnus/8-multi-service-boot into main
Member

Refs #8

  • mcl_om:boot/1,2 now adds its service to the ones the node hosts. boot([Mod | {Mod, Opts}]) boots a list and answers {ok, [{Mod, Pid}]} or {error, {Mod, Reason}}. A standalone single boot/1 behaves as before.
  • A service's org is info/0's org, else the org env.
  • Capabilities are kept per service and advertised per org (register/3, list/1).
  • <org>/info and describe_capabilities answer for their own service.
  • Health combines the services and names a failing one. /health lists each one's info under services.
  • One claim per distinct org (mcl_om_claim:add_org/1).
  • mcl_om_singleton: a child under a global name that runs on exactly one node; standbys take over.

Tests: f5ac356 is the red commit, alone.

  • Two services in one VM (mcl_om_SUITE).
  • One claim per org (mcl_om_claim_tests).
  • Two peer nodes on loopback (mcl_om_singleton_SUITE).

Local results: eunit 473/0, ct 78 passed (template suite under a scratch HOME), lint, xref and dialyzer clean. Mutants killed: dropping the stand-down, and claiming an org twice.

Refs #8 - `mcl_om:boot/1,2` now adds its service to the ones the node hosts. `boot([Mod | {Mod, Opts}])` boots a list and answers `{ok, [{Mod, Pid}]}` or `{error, {Mod, Reason}}`. A standalone single `boot/1` behaves as before. - A service's org is `info/0`'s `org`, else the `org` env. - Capabilities are kept per service and advertised per org (`register/3`, `list/1`). - `<org>/info` and `describe_capabilities` answer for their own service. - Health combines the services and names a failing one. `/health` lists each one's info under `services`. - One claim per distinct org (`mcl_om_claim:add_org/1`). - `mcl_om_singleton`: a child under a `global` name that runs on exactly one node; standbys take over. Tests: `f5ac356` is the red commit, alone. - Two services in one VM (mcl_om_SUITE). - One claim per org (mcl_om_claim_tests). - Two peer nodes on loopback (mcl_om_singleton_SUITE). Local results: eunit 473/0, ct 78 passed (template suite under a scratch HOME), lint, xref and dialyzer clean. Mutants killed: dropping the stand-down, and claiming an org twice.
Red until mcl_om hosts several services (mcl_om:boot/1 with a list,
service_modules/0, capabilities per org, health naming the failing service,
info and describe per service, a claim per org) and mcl_om_singleton exists.

Refs #8
feat: one release hosts several services, and a singleton helper (#8)
Some checks failed
lint-and-test / erlang in . (pull_request) Has been skipped
lint-and-test / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 2s
docs / snippets (pull_request) Failing after 5s
docs / Erlang blocks in the docs (pull_request) Failing after 0s
docs / snippets (push) Failing after 2s
docs / Erlang blocks in the docs (push) Failing after 0s
lint-and-test / erlang in . (container) (pull_request) Successful in 13s
lint-and-test / Dependency advisories (pull_request) Successful in 0s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 5m2s
87fbd515ac
mcl_om:boot/1,2 now adds its service to the ones the node hosts, and
boot/1 takes a list for a bundle. Each service advertises under its own
org (info/0's `org`, else the env), with its own capability set merged
beside the others', its own info and describe handlers, and a claim per
distinct org. Health combines the services and names a failing one. One
identity key, one pool, one health socket, as before; a standalone
release's single boot/1 behaves as it did.

mcl_om_singleton runs a child on exactly one node of a cluster under a
`global` name: standbys take over when the holder's node goes, and two
holders that meet keep the one on the node whose name sorts first.

Refs #8
claim: a restarted worker claims again for every hosted org, not only the env's (review r1, #8)
Some checks failed
lint-and-test / erlang in . (pull_request) Has been skipped
docs / snippets (pull_request) Failing after 1s
docs / Erlang blocks in the docs (pull_request) Failing after 0s
docs / snippets (push) Failing after 3s
docs / Erlang blocks in the docs (push) Failing after 0s
lint-and-test / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 3s
lint-and-test / erlang in . (container) (pull_request) Successful in 13s
lint-and-test / Dependency advisories (pull_request) Successful in 0s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Has been cancelled
6869ac187a
singleton: a start that answers ignore or {ok, Pid, Info} (review r1 nit, #8)
Some checks failed
docs / snippets (pull_request) Failing after 5s
lint-and-test / erlang in . (pull_request) Has been skipped
docs / Erlang blocks in the docs (pull_request) Failing after 0s
lint-and-test / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 4s
lint-and-test / erlang in . (container) (pull_request) Successful in 8s
lint-and-test / Dependency advisories (pull_request) Successful in 0s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 6m1s
lint-and-test / erlang in . (push) Has been skipped
docs / snippets (push) Failing after 3s
docs / Erlang blocks in the docs (push) Failing after 0s
lint-and-test / scaffold lint toolchain runs in its pinned image (push) Failing after 4s
lint-and-test / erlang in . (container) (push) Successful in 11s
lint-and-test / Dependency advisories (push) Successful in 0s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (push) Successful in 6m13s
a2aa62e3bd
The work's start function answers as a supervisor child's does. {ok, Pid,
Info} runs the work as {ok, Pid} does; ignore ends the guard as an ignored
child, and global drops its name with it. Before, both crashed the guard
with a case_clause (Jupiter, r1).

The moduledoc now says that a netsplit runs one copy per connected
partition, and that resolve/3 keeps one when the parts meet (Jupiter's
note, r1).

Refs #8
Member

Landed by fast-forward: main is a2aa62e3bd (from 2a15aefe). This repository does not allow the manually-merged style, so the PR is closed by hand.

Landed by fast-forward: main is a2aa62e3bd2f4c231ff652a028fb67dfa5decb3c (from 2a15aefe). This repository does not allow the manually-merged style, so the PR is closed by hand.
terra closed this pull request 2026-12-02 06:47:44 +00:00
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
macula-services/mcl-om!10
No description provided.