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

bedrock-kv / bedrock / 5a520c967f063d01f1e728970e1aa01f9eeb534f
82%

Build:
DEFAULT BRANCH: develop
Ran 26 Aug 2026 04:28PM UTC
Jobs 1
Files 217
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

26 Aug 2026 04:11PM UTC coverage: 79.639% (+0.5%) from 79.094%
5a520c967f063d01f1e728970e1aa01f9eeb534f

push

github

web-flow
Make recomputing health and waking waiters one act (#219)

Closes bedrock-n5h, under epic bedrock-gu0. **Stacked on #218**, itself
stacked on #213. GitHub retargets as each merges.

`do_remove_worker/2` and `do_remove_workers/2` recomputed the verdict
but never called `notify_waiting_for_healthy/1`. Only
`do_worker_health/3` paired them — by hand.

So removing the last failing worker flipped health to `:ok` and told
nobody. A caller parked in `wait_for_healthy/2` (default timeout
`:infinity`) slept through the exact moment its condition became true.

### The audit found the same gap in the opposite direction

`do_new_worker/4` is a **fourth** writer of `t.workers` and recomputed
nothing at all. A fresh node folds an empty worker set to `:ok`, so
adding a worker that then fails to start left the foreman reporting
healthy while hosting a dead one — and `do_wait_for_healthy/2`
short-circuits `:ok` immediately. Nothing corrected it, since recompute
is otherwise reachable only from a worker's own health cast and Shale
never sends one.

I had written a docstring claiming *"every health change goes through
here"* while only three of four writers did. Rather than weaken the
claim, this PR makes it true: `settle_health/1` now covers all four.

### Why a helper rather than four fixed call sites

The pairing stops being something a call site can forget. Forgetting it
is precisely how three of the four came to differ from each other.

Spin-up uses it too, though no waiter can exist there — it runs in the
`:spin_up` `handle_continue`, which precedes every mailbox message. The
notify is a no-op today and is there anyway, because "provably no
waiters" is a property of the current call ordering rather than of that
code.

### Verification

2821 tests, 0 failures. `mix compile --warnings-as-errors`, format,
credo and dialyzer all clean. Two of the four original tests fail
against the pre-fix code; the `do_new_worker` test fails against the
un-fixed version of that path... (continued)

5 of 6 new or added lines in 1 file covered. (83.33%)

4 existing lines in 1 file now uncovered.

6927 of 8698 relevant lines covered (79.64%)

1025.0 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
83.33
22.01% lib/bedrock/service/foreman/impl.ex

Coverage Regressions

Lines Coverage ∆ File
4
83.33
22.01% lib/bedrock/service/foreman/impl.ex
Jobs
ID Job ID Ran Files Coverage
1 5a520c967f063d01f1e728970e1aa01f9eeb534f.1 26 Aug 2026 04:28PM UTC 217
79.64
GitHub Action Run
Source Files on build 5a520c967f063d01f1e728970e1aa01f9eeb534f
  • Tree
  • List 217
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 5a520c96 on github
  • Prev Build on develop (#21616497...)
  • Next Build on develop (#636FBF24...)
  • 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