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

nats-io / nats-server / 9426248077 / 1
83%
main: 83%

Build:
DEFAULT BRANCH: main
Ran 08 Jun 2024 05:31AM UTC
Files 55
Run time 2s
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

07 Jun 2024 11:47PM UTC coverage: 85.257% (+0.07%) from 85.189%
9426248077.1

push

github

web-flow
Improve leadership change signaling (#5504)

Because leadership status can sometimes change very quickly and
raft.updateLeadChange() can 'drop' some lead change signals, especially
with the leadc channel having a capacity of one, which means that
sometimes stream.setLeader(isLeader bool) gets called twice in a row
with the same isLeader value.

This could lead to in some cases the sourcing to 'stall' (not all
messages gets sourced) or 'duplicate messages' (more messages than
expected get sourced).

Changes are increasing the leadc channel's size to 32.

The effects of the change can be demonstrated by running the
TestStreamSourcingScalingSourcingManyBenchmark load test a large number
of times (e.g. 100 times): without these changes the test flaps and
fails between 10 and 20% of the time (most of the time 'stalling' but
also sometimes with 'too many'). With the changes over around a hundred
runs not once did the test fail with 'stalling' and only once did it
fail with 'too many' messages (so there's still a bug/corner case that
could result in 'more than expected' messages to be sourced, although it
seems to be a rare occurence (i.e. 1% of the time)).

This is a replacement for #5496

---------

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>

65670 of 77026 relevant lines covered (85.26%)

946277.52 hits per line

Source Files on job 9426248077.1
  • Tree
  • List 0
  • Changed 44
  • Source Changed 5
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 9426248077
  • 27b8f624 on github
  • Prev Job for on main (#9411753283.1)
  • Next Job for on main (#9434031324.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc