[PR #2952] [CLOSED] [relay client] choose nearest relay based on latency #20948

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2952
Author: @mohamed-essam
Created: 11/25/2024
Status: Closed

Base: mainHead: main


📝 Commits (5)

  • ed1a18a relay client: choose nearest relay based on latency
  • db61cf2 Do not send nil relayClient to successChan
  • 18216ba Add timeout after first relay success
  • adf31ce check if we have a successful connection so we do not need to connect to other servers
  • df1c905 Fix panic on nil processingCtxCancel

📊 Changes

3 files changed (+89 additions, -32 deletions)

View changed files

📝 relay/client/client.go (+8 -6)
📝 relay/client/dialer/ws/ws.go (+13 -6)
📝 relay/client/picker.go (+68 -20)

📄 Description

Describe your changes

Change picker to choose nearest relay based on connection latency.

https://github.com/netbirdio/netbird/issues/2950

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/2952 **Author:** [@mohamed-essam](https://github.com/mohamed-essam) **Created:** 11/25/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (5) - [`ed1a18a`](https://github.com/netbirdio/netbird/commit/ed1a18a0bfa2ecb88c92cbe91450653adba30704) relay client: choose nearest relay based on latency - [`db61cf2`](https://github.com/netbirdio/netbird/commit/db61cf20c5dd4d458f6a20e8678651bccf7acb22) Do not send nil relayClient to successChan - [`18216ba`](https://github.com/netbirdio/netbird/commit/18216ba6429467557d5011d00ff226caa8ff8022) Add timeout after first relay success - [`adf31ce`](https://github.com/netbirdio/netbird/commit/adf31ce0a2206c38affc562a00851383bf5f85fe) check if we have a successful connection so we do not need to connect to other servers - [`df1c905`](https://github.com/netbirdio/netbird/commit/df1c9059ffd3e8ad1b4cb425891049338cf7844a) Fix panic on nil processingCtxCancel ### 📊 Changes **3 files changed** (+89 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `relay/client/client.go` (+8 -6) 📝 `relay/client/dialer/ws/ws.go` (+13 -6) 📝 `relay/client/picker.go` (+68 -20) </details> ### 📄 Description ## Describe your changes Change picker to choose nearest relay based on connection latency. ## Issue ticket number and link https://github.com/netbirdio/netbird/issues/2950 ### 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 05:07:54 -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#20948