[PR #2758] [MERGED] [client] Fix controller re-connection #20410

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2758
Author: @pappz
Created: 10/18/2024
Status: Merged
Merged: 10/24/2024
Merged by: @pappz

Base: mainHead: relay/fix-controller-reconnection


📝 Commits (10+)

📊 Changes

29 files changed (+814 additions, -524 deletions)

View changed files

📝 .github/workflows/golang-test-linux.yml (+2 -5)
📝 client/iface/bind/ice_bind.go (+0 -1)
📝 client/iface/wgproxy/ebpf/portlookup.go (+2 -2)
📝 client/iface/wgproxy/ebpf/portlookup_test.go (+3 -0)
📝 client/iface/wgproxy/factory_kernel.go (+2 -0)
📝 client/iface/wgproxy/factory_kernel_freebsd.go (+3 -0)
📝 client/iface/wgproxy/factory_usp.go (+3 -0)
📝 client/iface/wgproxy/udp/proxy.go (+20 -8)
📝 client/internal/engine.go (+21 -2)
📝 client/internal/engine_test.go (+3 -0)
📝 client/internal/peer/conn.go (+65 -161)
client/internal/peer/conn_monitor.go (+0 -212)
📝 client/internal/peer/conn_test.go (+11 -5)
client/internal/peer/guard/guard.go (+194 -0)
client/internal/peer/guard/ice_monitor.go (+135 -0)
client/internal/peer/guard/sr_watcher.go (+119 -0)
client/internal/peer/ice/agent.go (+89 -0)
client/internal/peer/ice/config.go (+22 -0)
📝 client/internal/peer/ice/env.go (+12 -10)
📝 client/internal/peer/ice/stdnet.go (+1 -1)

...and 9 more files

📄 Description

Describe your changes

Rethink the peer reconnection code organization.

Watch these events:

  • Relay client reconnected to home server
  • Signal server connection state changed
  • ICE connection disconnected
  • Relayed connection disconnected
  • ICE candidate changes

Fixed issues:

  • Fix exponent ticker timeout cancellation
  • Fix missed disconnected events handling
  • Start to use reconnected events

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/2758 **Author:** [@pappz](https://github.com/pappz) **Created:** 10/18/2024 **Status:** ✅ Merged **Merged:** 10/24/2024 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `main` ← **Head:** `relay/fix-controller-reconnection` --- ### 📝 Commits (10+) - [`9d75cc3`](https://github.com/netbirdio/netbird/commit/9d75cc32735bc4b9e188c65804fa58511dc9fdf9) Add pause function for proxies - [`acad98e`](https://github.com/netbirdio/netbird/commit/acad98e328bcc7f7489aab07b6d5f923be5846c2) Code cleaning - [`90d9dd4`](https://github.com/netbirdio/netbird/commit/90d9dd4c0823dfba6004437ce7cb6abc371a1ae2) Remove unused function from eBPF proxy - [`f18ae8b`](https://github.com/netbirdio/netbird/commit/f18ae8b925ea6cc62f7df7b2ae3205df830a177e) Apply pause logic - [`48184ec`](https://github.com/netbirdio/netbird/commit/48184ecf21fbe68a6d83e6b92347762c619b58e8) Fix eBPF pause handling - [`718d952`](https://github.com/netbirdio/netbird/commit/718d9526a755fe518e6fc1e0082b77f382991100) Fix test - [`9e7aac3`](https://github.com/netbirdio/netbird/commit/9e7aac3a56d41532223d96506edee47652c8ab6b) Reducate cognitive complexity - [`1f25bb0`](https://github.com/netbirdio/netbird/commit/1f25bb075169a7e8ff9d9f021e53ceaee0a487f4) Reducate cognitive complexity - [`ba3cdb3`](https://github.com/netbirdio/netbird/commit/ba3cdb30ee2c3801d346a6a57f37305b310d7a9c) Remove unnecessary ctx cancel check - [`20815c9`](https://github.com/netbirdio/netbird/commit/20815c9f90a8e50a1022a8d5045543b2a9e224c7) Remove unused function ### 📊 Changes **29 files changed** (+814 additions, -524 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/golang-test-linux.yml` (+2 -5) 📝 `client/iface/bind/ice_bind.go` (+0 -1) 📝 `client/iface/wgproxy/ebpf/portlookup.go` (+2 -2) 📝 `client/iface/wgproxy/ebpf/portlookup_test.go` (+3 -0) 📝 `client/iface/wgproxy/factory_kernel.go` (+2 -0) 📝 `client/iface/wgproxy/factory_kernel_freebsd.go` (+3 -0) 📝 `client/iface/wgproxy/factory_usp.go` (+3 -0) 📝 `client/iface/wgproxy/udp/proxy.go` (+20 -8) 📝 `client/internal/engine.go` (+21 -2) 📝 `client/internal/engine_test.go` (+3 -0) 📝 `client/internal/peer/conn.go` (+65 -161) ➖ `client/internal/peer/conn_monitor.go` (+0 -212) 📝 `client/internal/peer/conn_test.go` (+11 -5) ➕ `client/internal/peer/guard/guard.go` (+194 -0) ➕ `client/internal/peer/guard/ice_monitor.go` (+135 -0) ➕ `client/internal/peer/guard/sr_watcher.go` (+119 -0) ➕ `client/internal/peer/ice/agent.go` (+89 -0) ➕ `client/internal/peer/ice/config.go` (+22 -0) 📝 `client/internal/peer/ice/env.go` (+12 -10) 📝 `client/internal/peer/ice/stdnet.go` (+1 -1) _...and 9 more files_ </details> ### 📄 Description ## Describe your changes Rethink the peer reconnection code organization. Watch these events: - Relay client reconnected to home server - Signal server connection state changed - ICE connection disconnected - Relayed connection disconnected - ICE candidate changes ### Fixed issues: - Fix exponent ticker timeout cancellation - Fix missed disconnected events handling - Start to use reconnected events ## Issue ticket number and link ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [x] 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:07:13 -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#20410