[PR #5859] [CLOSED] [management] fix resource and router changes not propagating to peers #26958

Open
opened 2026-08-05 07:08:01 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5859
Author: @Wouter0100
Created: 4/12/2026
Status: Closed

Base: mainHead: fix/network-changes-peers


📝 Commits (1)

  • 864aa48 [management] fix resource and router changes not propagating to peers

📊 Changes

3 files changed (+7 additions, -7 deletions)

View changed files

📝 management/server/networks/manager.go (+1 -1)
📝 management/server/networks/resources/manager.go (+3 -3)
📝 management/server/networks/routers/manager.go (+3 -3)

📄 Description

Describe your changes

Goroutines in the networks package called UpdateAccountPeers with the HTTP request context. After the response was sent, the request context was cancelled, causing GetAccountWithBackpressure to return ctx.Err() and silently drop the peer notification.

Fix by passing context.WithoutCancel(ctx) to these goroutines so they survive the request lifecycle while still inheriting trace/log values.

Group handlers were unaffected because they call UpdateAccountPeers synchronously before the response is returned.

Curious to hear if this is as desired. I've verified the changes on my NetBird setup.

Fixes #5813

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Bugfix

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where peer updates could be interrupted when creating, updating, or deleting networks, resources, and routers.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5859 **Author:** [@Wouter0100](https://github.com/Wouter0100) **Created:** 4/12/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/network-changes-peers` --- ### 📝 Commits (1) - [`864aa48`](https://github.com/netbirdio/netbird/commit/864aa480ec80e9f63926c655744975b1fae5dd64) [management] fix resource and router changes not propagating to peers ### 📊 Changes **3 files changed** (+7 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `management/server/networks/manager.go` (+1 -1) 📝 `management/server/networks/resources/manager.go` (+3 -3) 📝 `management/server/networks/routers/manager.go` (+3 -3) </details> ### 📄 Description ## Describe your changes Goroutines in the networks package called `UpdateAccountPeers` with the HTTP request context. After the response was sent, the request context was cancelled, causing `GetAccountWithBackpressure` to return `ctx.Err()` and silently drop the peer notification. Fix by passing `context.WithoutCancel(ctx)` to these goroutines so they survive the request lifecycle while still inheriting trace/log values. Group handlers were unaffected because they call `UpdateAccountPeers` synchronously before the response is returned. Curious to hear if this is as desired. I've verified the changes on my NetBird setup. ## Issue ticket number and link Fixes #5813 ## Stack <!-- branch-stack --> ### Checklist - [X] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [X] Documentation is **not needed** for this change (explain why) Bugfix <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed an issue where peer updates could be interrupted when creating, updating, or deleting networks, resources, and routers. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 07:08:01 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#26958