[PR #3250] [CLOSED] [relay-client] Fix reconnection #16900

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/3250
Author: @pappz
Created: 1/29/2025
Status: Closed

Base: mainHead: fix/relay-reconnection


📝 Commits (2)

  • 14a99a8 Remove the on reconnect callback from client layer. This event will be managed by guard.
  • 5d403a7 Remove unused function

📊 Changes

3 files changed (+57 additions, -42 deletions)

View changed files

📝 relay/client/client.go (+0 -18)
📝 relay/client/guard.go (+48 -23)
📝 relay/client/manager.go (+9 -1)

📄 Description

Describe your changes

After we started to allow the agent to run without an established Relay connection the reconnection and connection definition has been changed. In this PR I fix these incosistency.

  • The client structure does not manage the reconnection callback anymore
  • If the quick reconnection (to the original home server) is success we will trigger the onReconnection callback

Original issue:

When you start the agent without a Relay connection, it attempts to reconnect for a while before allowing operation without an active Relay connection. In the background, it periodically tries to establish the connection. If successful, it does not notify peers about the changes.

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/3250 **Author:** [@pappz](https://github.com/pappz) **Created:** 1/29/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/relay-reconnection` --- ### 📝 Commits (2) - [`14a99a8`](https://github.com/netbirdio/netbird/commit/14a99a8693ec4265ce5d6cf54986edb63cd59c9c) Remove the on reconnect callback from client layer. This event will be managed by guard. - [`5d403a7`](https://github.com/netbirdio/netbird/commit/5d403a79ba285d09ee4c132daf6c8c73e885f78e) Remove unused function ### 📊 Changes **3 files changed** (+57 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `relay/client/client.go` (+0 -18) 📝 `relay/client/guard.go` (+48 -23) 📝 `relay/client/manager.go` (+9 -1) </details> ### 📄 Description ## Describe your changes After we started to allow the agent to run without an established Relay connection the reconnection and connection definition has been changed. In this PR I fix these incosistency. - The client structure does not manage the reconnection callback anymore - If the quick reconnection (to the original home server) is success we will trigger the onReconnection callback ### Original issue: When you start the agent without a Relay connection, it attempts to reconnect for a while before allowing operation without an active Relay connection. In the background, it periodically tries to establish the connection. If successful, it does not notify peers about the changes. ## Issue ticket number and link ### 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 04:06:41 -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#16900