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

nats-io / nats-server / 21309443736

23 Jan 2026 03:26PM UTC coverage: 84.562% (-0.1%) from 84.674%
21309443736

push

github

web-flow
Perform `_writeFullState` under read lock only (#7759)

Previously the `_writeFullState` calls would take the store write lock,
but if the store is very read-heavy with e.g. lots of consumers, this
creates a significant contention on those trying to acquire `RLock` and
results in pauses that may cause caches to expire. Therefore:

- A new `wfsmu` is added to allow only one of these calls to run at a
time — it protects the average delete map length field, and also means
that we can't have two `_writeFullState` goroutines writing to the same
file at the same time;
- The `fs.mu` is now `RLock` instead of `Lock`

Signed-off-by: Neil Twigg <neil@nats.io>

74262 of 87820 relevant lines covered (84.56%)

359193.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.16
/src/github.com/nats-io/nats-server/server/leafnode.go


Source Not Available

The file "src/github.com/nats-io/nats-server/server/leafnode.go" isn't available on github. Either it's been removed, or the repo root directory needs to be updated.

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