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

nats-io / nats-server / 41774732748 / 1
76%
main: 76%

Build:
DEFAULT BRANCH: main
Ran 04 Nov 2026 05:47AM UTC
Files 66
Run time 4s
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

03 Nov 2026 12:14PM UTC coverage: 76.766% (-4.7%) from 81.507%
41774732748.1

push

github

web-flow
server: remove leaf connection from s.leafs if it closed during accept (#8838)

Fixes #8827.

On the accepting (hub) side, `processLeafNodeConnect` registers the leaf
via `addLeafNodeConnection` but never rechecked afterward whether the
connection had closed concurrently (e.g. during the leaf auth timeout
window) — unlike the soliciting side's `leafNodeFinishConnectProcess`,
which already rechecks `isClosed()` and removes the entry. A connection
closing in that window was left registered forever, inflating
`NumLeafNodes()`/`Leafz`. This mirrors the existing soliciting-side
check-and-remove pattern on the accepting side.

## Test plan
- Added `TestLeafNodeAcceptSideClosedDuringConnectNotLeaked` in
`server/leafnode_test.go`, which drives `processLeafNodeConnect`
directly with a client already marked closed to deterministically
reproduce the race window (no timing dependence). Verified it fails
without the fix (`NumLeafNodes()=1`) and passes with it.
- `go test ./server/ -run 'TestLeafNode' -v` (149+ subtests pass;
isolated reruns of any run that flaked on this large machine due to
transient port reuse/exhaustion pass cleanly, unrelated to this change).
- `go vet ./server/...` — clean.
- `gofmt -l server/leafnode.go server/leafnode_test.go` — clean.

68109 of 88723 relevant lines covered (76.77%)

285686.7 hits per line

Source Files on job 41774732748.1
  • Tree
  • List 66
  • Changed 30
  • Source Changed 4
  • Coverage Changed 30
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 41774732748
  • ca2c4da1 on github
  • Prev Job for on main (#41579592121.1)
  • Next Job for on main (#41969369976.1)
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