[PR #1100] [MERGED] Feature/ephemeral peers #13312

Closed
opened 2026-08-05 02:08:04 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/1100
Author: @pappz
Created: 8/22/2023
Status: Merged
Merged: 9/4/2023
Merged by: @pappz

Base: mainHead: feature/ephemeral-peers


📝 Commits (10+)

📊 Changes

21 files changed (+455 additions, -39 deletions)

View changed files

📝 client/cmd/testutil.go (+1 -1)
📝 client/internal/engine_test.go (+1 -1)
📝 management/client/client_test.go (+1 -1)
📝 management/cmd/management.go (+5 -1)
📝 management/server/account.go (+1 -1)
📝 management/server/account_test.go (+4 -3)
📝 management/server/activity/event.go (+4 -0)
management/server/ephemeral.go (+224 -0)
management/server/ephemeral_test.go (+142 -0)
📝 management/server/grpcserver.go (+17 -8)
📝 management/server/http/api/openapi.yml (+9 -0)
📝 management/server/http/api/types.gen.go (+6 -0)
📝 management/server/http/setupkeys_handler.go (+5 -1)
📝 management/server/http/setupkeys_handler_test.go (+2 -2)
📝 management/server/management_proto_test.go (+3 -1)
📝 management/server/management_test.go (+1 -1)
📝 management/server/mock_server/account_mock.go (+3 -2)
📝 management/server/peer.go (+6 -0)
📝 management/server/peer_test.go (+3 -3)
📝 management/server/setupkey.go (+8 -4)

...and 1 more files

📄 Description

Describe your changes

The ephemeral manager keep the inactive ephemeral peers in a linked list. The manager schedule a cleanup procedure to the head of the linked list (to the most deprecated peer). At the end of cleanup schedule the next cleanup to the new head.
If a device connect back to the server the manager will remote it from the peers list.

Relevant Dashboard PR: https://github.com/netbirdio/dashboard/pull/263

NB-37

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/1100 **Author:** [@pappz](https://github.com/pappz) **Created:** 8/22/2023 **Status:** ✅ Merged **Merged:** 9/4/2023 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `main` ← **Head:** `feature/ephemeral-peers` --- ### 📝 Commits (10+) - [`b2e563d`](https://github.com/netbirdio/netbird/commit/b2e563d810e0cc85ff721e9d304d651f72bf23b3) Add main ephemeral logic - [`06e7257`](https://github.com/netbirdio/netbird/commit/06e72577703438639551cf74b3eb2959d3f7b46e) Fix GRPC error handling - [`7bae2e4`](https://github.com/netbirdio/netbird/commit/7bae2e40e68d23515efc7b7b156a36cbe490a186) Integrate for server - [`bb6dd72`](https://github.com/netbirdio/netbird/commit/bb6dd7222e9639dd232f76b0e398ec652e9d01ee) Optimise algorithm - [`2354a2d`](https://github.com/netbirdio/netbird/commit/2354a2dc0281a201a228beb1dd489287c3c019c6) Add ephemeral property for setup key - [`edf3146`](https://github.com/netbirdio/netbird/commit/edf31466292ad58731d692d0a8dcbb3d8364cde5) Fix timer restart and add comment - [`813f478`](https://github.com/netbirdio/netbird/commit/813f4781c39ddd25bce993f086e78bbdb03dddd3) Bug fixes - [`d1d6df4`](https://github.com/netbirdio/netbird/commit/d1d6df481fbfc54550025c3852449cf0c7b44766) Fix test - [`27189cc`](https://github.com/netbirdio/netbird/commit/27189cc13963dfa4c450d0600e72ab1c861e5258) Invoke ephemeralManager.Stop - [`2a3625e`](https://github.com/netbirdio/netbird/commit/2a3625e3172c2f198ce0da988f566bdae9955eee) Add "sys" initiator for activity and code cleaning ### 📊 Changes **21 files changed** (+455 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/testutil.go` (+1 -1) 📝 `client/internal/engine_test.go` (+1 -1) 📝 `management/client/client_test.go` (+1 -1) 📝 `management/cmd/management.go` (+5 -1) 📝 `management/server/account.go` (+1 -1) 📝 `management/server/account_test.go` (+4 -3) 📝 `management/server/activity/event.go` (+4 -0) ➕ `management/server/ephemeral.go` (+224 -0) ➕ `management/server/ephemeral_test.go` (+142 -0) 📝 `management/server/grpcserver.go` (+17 -8) 📝 `management/server/http/api/openapi.yml` (+9 -0) 📝 `management/server/http/api/types.gen.go` (+6 -0) 📝 `management/server/http/setupkeys_handler.go` (+5 -1) 📝 `management/server/http/setupkeys_handler_test.go` (+2 -2) 📝 `management/server/management_proto_test.go` (+3 -1) 📝 `management/server/management_test.go` (+1 -1) 📝 `management/server/mock_server/account_mock.go` (+3 -2) 📝 `management/server/peer.go` (+6 -0) 📝 `management/server/peer_test.go` (+3 -3) 📝 `management/server/setupkey.go` (+8 -4) _...and 1 more files_ </details> ### 📄 Description ## Describe your changes The ephemeral manager keep the inactive ephemeral peers in a linked list. The manager schedule a cleanup procedure to the head of the linked list (to the most deprecated peer). At the end of cleanup schedule the next cleanup to the new head. If a device connect back to the server the manager will remote it from the peers list. Relevant Dashboard PR: https://github.com/netbirdio/dashboard/pull/263 ## Issue ticket number and link NB-37 ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] 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 02:08:04 -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#13312