Skip to content

internal/server/bgp: Preserve shared peer counts - #4169

Merged
stgraber merged 1 commit into
lxc:mainfrom
jovermier:fix-bgp-peer-reference-count
Oct 12, 2026
Merged

stgraber merged 1 commit into
lxc:mainfrom
jovermier:fix-bgp-peer-reference-count

Conversation

@jovermier

Copy link
Copy Markdown
Contributor

When multiple networks share a BGP peer, listener reconfiguration recreates the peer with a reference count of one. Removing one network can then remove the native peer while another network still needs it.

Preserve each peer's reference count when recreating it. Add a focused regression for peers queued before startup and peers on an already-running listener, checking the native GoBGP peer remains until its last reference is removed.

Validation: both cases fail on main and pass with the fix, including repeated race checks. Full Go tests, static-analysis recipes, and daemon/CLI builds pass.

Signed-off-by: Jason Overmier <jason.r.overmier@gmail.com>
@jovermier
jovermier requested a review from stgraber as a code owner October 10, 2026 15:11
@stgraber
stgraber force-pushed the fix-bgp-peer-reference-count branch from fa9444f to e7465ba Compare October 12, 2026 02:50
@stgraber
stgraber merged commit cba75d5 into lxc:main Oct 12, 2026
94 of 96 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants