[PR #3747] [MERGED] [client] Automatically start the connection if exclude list is changing #21381

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/3747
Author: @pappz
Created: 4/26/2025
Status: Merged
Merged: 5/2/2025
Merged by: @pappz

Base: feature/lazy-connectionHead: feature/lazy-connection-exclude


📝 Commits (4)

  • abcd413 Automatically start the connection if exclude list is changing
  • 4bbadee Move back the exclude list handling into earlier stage
  • f715314 Add comment
  • 75a6ccd Update comment

📊 Changes

3 files changed (+119 additions, -31 deletions)

View changed files

📝 client/internal/conn_mgr.go (+32 -2)
📝 client/internal/engine.go (+6 -6)
📝 client/internal/lazyconn/manager/manager.go (+81 -23)

📄 Description

Describe your changes

Fix the exclude list handling. When the agent gets a new network map, it manages the changes in the excluded peers.

Cases:

  • Extend the exclude list with a new peer: start permanent peer connection
  • Remove a peer from the exclude list: we do not know the actual state of the peer connection, so we must suppose it is not in "idle". Start the inactivity listener for peer.
  • If a peer is newly created in the management server and it will be in exclude list (i.e. it is a router) then the manager can not start the connection immediately because the peer.Conn is not exist yet. It is normal and the engine code will create the peer and start the connection in the next step.

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)
  • Extended the README / documentation, if necessary

🔄 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/3747 **Author:** [@pappz](https://github.com/pappz) **Created:** 4/26/2025 **Status:** ✅ Merged **Merged:** 5/2/2025 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `feature/lazy-connection` ← **Head:** `feature/lazy-connection-exclude` --- ### 📝 Commits (4) - [`abcd413`](https://github.com/netbirdio/netbird/commit/abcd4131e34fdce75943b48ce6da8674d8c08cf0) Automatically start the connection if exclude list is changing - [`4bbadee`](https://github.com/netbirdio/netbird/commit/4bbadeebc6f9fea5542d0773df7f3fe22304f101) Move back the exclude list handling into earlier stage - [`f715314`](https://github.com/netbirdio/netbird/commit/f7153142b8f2716dc4d5e26d284b1cac546fc9e1) Add comment - [`75a6ccd`](https://github.com/netbirdio/netbird/commit/75a6ccd7c330ed01c839858ab703eca3a4c0f1ca) Update comment ### 📊 Changes **3 files changed** (+119 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/conn_mgr.go` (+32 -2) 📝 `client/internal/engine.go` (+6 -6) 📝 `client/internal/lazyconn/manager/manager.go` (+81 -23) </details> ### 📄 Description ## Describe your changes Fix the exclude list handling. When the agent gets a new network map, it manages the changes in the excluded peers. Cases: - Extend the exclude list with a new peer: start permanent peer connection - Remove a peer from the exclude list: we do not know the actual state of the peer connection, so we must suppose it is not in "**idle**". Start the `inactivity listener` for peer. - If a peer is newly created in the management server and it will be in exclude list (i.e. it is a router) then the manager can not start the connection immediately because the `peer.Conn` is not exist yet. It is normal and the engine code will create the peer and start the connection in the next step. ## Issue ticket number and link ## 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) - [ ] Extended the README / documentation, if necessary --- <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 05:08:26 -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#21381