• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bedrock-kv / bedrock / 96683d054884fe11f960e7c61fab3a026cd4d75a
82%

Build:
DEFAULT BRANCH: develop
Ran 14 Sep 2026 05:28PM UTC
Jobs 1
Files 215
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Sep 2026 05:27PM UTC coverage: 81.248% (+0.5%) from 80.765%
96683d054884fe11f960e7c61fab3a026cd4d75a

push

github

web-flow
Start Foreman before Link; route Foreman lookups through the safe call wrapper (#320)

## Summary
Fixes the first of two defects in #319: a fresh strict cluster can fail
startup with `:noproc`.

- `ClusterSupervisor` started `Link` before the capability children that
include `Foreman`. `Link`'s post-init continuation queries the local
`Foreman` for its running services (to register a complete service
inventory with the coordinator atomically), so it could race a `Foreman`
that wasn't registered yet.
- `Link.Discovery.get_running_services_from_foreman/1` called `Foreman`
with a raw `GenServer.call/3` wrapped in `rescue`, which does not catch
the `:exit` signal a dead-process call raises — so the race crashed
`Link` instead of degrading gracefully.

## Changes
- Reorder `ClusterSupervisor`'s children list so capability children
(Foreman among them) start before `Link`, closing the race at its
source.
- Replace the raw `GenServer.call` + broken `rescue` with
`Bedrock.Service.Foreman.get_all_running_services/2`, which already
routes through `Bedrock.Internal.GenServer.Calls.call/3` — the project's
existing exit-safe call wrapper — so a still-possible
Foreman-unavailable case degrades to an empty list instead of crashing.

## Test plan
- [x] New test in `cluster_supervisor_test.exs` asserting Foreman's
normalized child spec precedes Link's in `ClusterSupervisor.init/1`'s
output (red before the reorder, green after).
- [x] New test in `discovery_test.exs` exercising
`Discovery.change_coordinator/2` with a capability set and an
unregistered Foreman name — reproduces the uncaught-exit crash on
current code, passes after the fix.
- [x] Full suite (`mix test`), `mix format --check-formatted`, `mix
credo --strict`, `mix dialyzer` all clean.
- Follow-up filed (bedrock-0hf, not in scope here):
`ClusterSupervisor.fetch_coordinator/1` has the same raw-call/rescue bug
against Link, found during review.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

2 of 3 new or added lines in 1 file covered. (66.67%)

7136 of 8783 relevant lines covered (81.25%)

1178.0 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
37.25
20.59% lib/bedrock/cluster/link/discovery.ex
Jobs
ID Job ID Ran Files Coverage
1 96683d054884fe11f960e7c61fab3a026cd4d75a.1 14 Sep 2026 05:28PM UTC 215
81.25
GitHub Action Run
Source Files on build 96683d054884fe11f960e7c61fab3a026cd4d75a
  • Tree
  • List 215
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 96683d05 on github
  • Prev Build on develop (#B0167D2E...)
  • Next Build on develop (#CED5317A...)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc