[PR #2488] [MERGED] [relay] Fix peer close function #17479

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2488
Author: @pappz
Created: 8/27/2024
Status: Merged
Merged: 8/28/2024
Merged by: @pappz

Base: feature/relay-integrationHead: feature/relay-integration-fix-down


📝 Commits (1)

📊 Changes

3 files changed (+24 additions, -13 deletions)

View changed files

📝 client/internal/peer/conn.go (+17 -5)
📝 client/internal/peer/worker_relay.go (+6 -7)
📝 relay/client/client.go (+1 -1)

📄 Description

Describe your changes

Fix netbird down command

The ICE agent closes the connection in async way. After the close event, it restarted the connection upgrade to Relay. In the relay code it started new go routines. Check the context.Err() in all cases when an event can happen in async way.

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/2488 **Author:** [@pappz](https://github.com/pappz) **Created:** 8/27/2024 **Status:** ✅ Merged **Merged:** 8/28/2024 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `feature/relay-integration` ← **Head:** `feature/relay-integration-fix-down` --- ### 📝 Commits (1) - [`a5e1ffa`](https://github.com/netbirdio/netbird/commit/a5e1ffae56a3d8aef1c38cb12de3f2c67bc1c6eb) Fix peer close function ### 📊 Changes **3 files changed** (+24 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/peer/conn.go` (+17 -5) 📝 `client/internal/peer/worker_relay.go` (+6 -7) 📝 `relay/client/client.go` (+1 -1) </details> ### 📄 Description ## Describe your changes Fix **netbird down** command The ICE agent closes the connection in async way. After the close event, it restarted the connection upgrade to Relay. In the relay code it started new go routines. Check the context.Err() in all cases when an event can happen in async way. ## 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:07:22 -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#17479