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

bedrock-kv / bedrock / 8415dbf89a1b79e0bb2b2ae7fae2c0b37488faf6
82%

Build:
DEFAULT BRANCH: develop
Ran 25 Aug 2026 02:55PM 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

25 Aug 2026 02:54PM UTC coverage: 78.239% (-0.03%) from 78.264%
8415dbf89a1b79e0bb2b2ae7fae2c0b37488faf6

push

github

web-flow
Commit path: full-jitter backoff, ETS routing cache, adaptive batching (#209)

Ticket: `bedrock-62e`. Found while chasing a reported slowdown in the
class-scheduling demo's "dans" section.

## The defect

```elixir
base_delay = 1 <<< retry_count
jitter = :rand.uniform(3)          # one to three milliseconds
```

A ceiling that doubles, with 1–3ms of jitter. Transactions contending on
one key fail at nearly the same instant, compute nearly the same delay,
and **wake together** — so they collide again, and the round trip
repeats at twice the delay. The work is trivial; the wall clock is set
by whichever contender climbs furthest up the ladder.

## Measured

100 concurrent signups against one seat counter, ten independent rounds,
fresh class each round:

| | median | **max** | total |
|---|---|---|---|
| before | 285ms / 540ms | **1058ms / 3057ms** | 4761ms / 7161ms |
| after | 210ms / 202ms | **387ms / 320ms** | 2327ms / 2054ms |

Before, samples snap to a ladder — `280, 540, 1058, 3057` — every
contender climbing the same rungs. After, they spread and the tail
collapses **2.7–9.5×**.

## The fix is FDB's

Full jitter: the delay is a uniform draw from the **whole** interval
below the ceiling, and only the *ceiling* grows.

- `NativeAPI.actor.cpp:4436` — `returnedBackoff *=
deterministicRandom()->random01();`
- `:4446` — `backoff = std::min(backoff *
CLIENT_KNOBS->BACKOFF_GROWTH_RATE, ...)`
- `ClientKnobs.cpp:67-69` — 10ms initial, 1s max, growth 2.0

The ceiling schedule here is **unchanged**. What changed is drawing from
all of it rather than a 3ms band at its top. Never zero, so a retry
cannot become a spin.

## Not a regression

Bisected: 198ms at `0.5.3`, 150ms at `0.6.0`, 283ms at `0.6.1`-era,
277ms pre-merge, 281ms today. Pickaxe dates the schedule to `602f0c8a`.
It has always been this way and was simply never measured.

## Tests

`retry_delay_in_ms/1` extracted as a pure function and tested for
properties rather than values: ceiling still double... (continued)

30 of 36 new or added lines in 6 files covered. (83.33%)

2 existing lines in 1 file now uncovered.

6770 of 8653 relevant lines covered (78.24%)

1033.64 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
7.89
-21.05% lib/bedrock/cluster/link/server.ex

Coverage Regressions

Lines Coverage ∆ File
2
7.89
-21.05% lib/bedrock/cluster/link/server.ex
Jobs
ID Job ID Ran Files Coverage
1 8415dbf89a1b79e0bb2b2ae7fae2c0b37488faf6.1 25 Aug 2026 02:55PM UTC 217
78.24
GitHub Action Run
Source Files on build 8415dbf89a1b79e0bb2b2ae7fae2c0b37488faf6
  • Tree
  • List 217
  • Changed 8
  • Source Changed 0
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8415dbf8 on github
  • Prev Build on develop (#04D7FFF8...)
  • Next Build on develop (#780BD9F6...)
  • 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